X-Git-Url: http://git.agner.ch/gitweb/?a=blobdiff_plain;f=arch%2Fpowerpc%2Fplatforms%2Fiseries%2Fviopath.c;h=e2100ece9c652759162dec6f7b0bee08656a9297;hb=f8abea8f8c24ecdad6d6861bffb912f23f2741cd;hp=04e07e5da0c10010d7e2c458fc4adb9f921b6779;hpb=946b92437e550d6ed80213bf54a1f383e141aede;p=linux-drm-fsl-dcu.git diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c index 04e07e5da0c1..e2100ece9c65 100644 --- a/arch/powerpc/platforms/iseries/viopath.c +++ b/arch/powerpc/platforms/iseries/viopath.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -119,10 +120,9 @@ static int proc_viopath_show(struct seq_file *m, void *v) struct device_node *node; const char *sysid; - buf = kmalloc(HW_PAGE_SIZE, GFP_KERNEL); + buf = kzalloc(HW_PAGE_SIZE, GFP_KERNEL); if (!buf) return 0; - memset(buf, 0, HW_PAGE_SIZE); handle = dma_map_single(iSeries_vio_dev, buf, HW_PAGE_SIZE, DMA_FROM_DEVICE); @@ -173,7 +173,7 @@ static int proc_viopath_open(struct inode *inode, struct file *file) return single_open(file, proc_viopath_show, NULL); } -static struct file_operations proc_viopath_operations = { +static const struct file_operations proc_viopath_operations = { .open = proc_viopath_open, .read = seq_read, .llseek = seq_lseek, @@ -184,6 +184,9 @@ static int __init vio_proc_init(void) { struct proc_dir_entry *e; + if (!firmware_has_feature(FW_FEATURE_ISERIES)) + return 0; + e = create_proc_entry("iSeries/config", 0, NULL); if (e) e->proc_fops = &proc_viopath_operations;