Commit 0fd68946 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by Linus Torvalds

parisc: use non-racy method for proc entries creation

Use proc_create() to make sure that ->proc_fops be setup before gluing PDE to
main tree.
Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
Cc: Kyle McMartin <kyle@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c33fff0a
...@@ -1551,8 +1551,7 @@ static int __init ccio_probe(struct parisc_device *dev) ...@@ -1551,8 +1551,7 @@ static int __init ccio_probe(struct parisc_device *dev)
{ {
int i; int i;
struct ioc *ioc, **ioc_p = &ioc_list; struct ioc *ioc, **ioc_p = &ioc_list;
struct proc_dir_entry *info_entry, *bitmap_entry;
ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL); ioc = kzalloc(sizeof(struct ioc), GFP_KERNEL);
if (ioc == NULL) { if (ioc == NULL) {
printk(KERN_ERR MODULE_NAME ": memory allocation failure\n"); printk(KERN_ERR MODULE_NAME ": memory allocation failure\n");
...@@ -1580,13 +1579,10 @@ static int __init ccio_probe(struct parisc_device *dev) ...@@ -1580,13 +1579,10 @@ static int __init ccio_probe(struct parisc_device *dev)
HBA_DATA(dev->dev.platform_data)->iommu = ioc; HBA_DATA(dev->dev.platform_data)->iommu = ioc;
if (ioc_count == 0) { if (ioc_count == 0) {
info_entry = create_proc_entry(MODULE_NAME, 0, proc_runway_root); proc_create(MODULE_NAME, 0, proc_runway_root,
if (info_entry) &ccio_proc_info_fops);
info_entry->proc_fops = &ccio_proc_info_fops; proc_create(MODULE_NAME"-bitmap", 0, proc_runway_root,
&ccio_proc_bitmap_fops);
bitmap_entry = create_proc_entry(MODULE_NAME"-bitmap", 0, proc_runway_root);
if (bitmap_entry)
bitmap_entry->proc_fops = &ccio_proc_bitmap_fops;
} }
ioc_count++; ioc_count++;
......
...@@ -1895,7 +1895,9 @@ sba_driver_callback(struct parisc_device *dev) ...@@ -1895,7 +1895,9 @@ sba_driver_callback(struct parisc_device *dev)
int i; int i;
char *version; char *version;
void __iomem *sba_addr = ioremap_nocache(dev->hpa.start, SBA_FUNC_SIZE); void __iomem *sba_addr = ioremap_nocache(dev->hpa.start, SBA_FUNC_SIZE);
struct proc_dir_entry *info_entry, *bitmap_entry, *root; #ifdef CONFIG_PROC_FS
struct proc_dir_entry *root;
#endif
sba_dump_ranges(sba_addr); sba_dump_ranges(sba_addr);
...@@ -1973,14 +1975,8 @@ sba_driver_callback(struct parisc_device *dev) ...@@ -1973,14 +1975,8 @@ sba_driver_callback(struct parisc_device *dev)
break; break;
} }
info_entry = create_proc_entry("sba_iommu", 0, root); proc_create("sba_iommu", 0, root, &sba_proc_fops);
bitmap_entry = create_proc_entry("sba_iommu-bitmap", 0, root); proc_create("sba_iommu-bitmap", 0, root, &sba_proc_bitmap_fops);
if (info_entry)
info_entry->proc_fops = &sba_proc_fops;
if (bitmap_entry)
bitmap_entry->proc_fops = &sba_proc_bitmap_fops;
#endif #endif
parisc_vmerge_boundary = IOVP_SIZE; parisc_vmerge_boundary = IOVP_SIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment