mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
drivers: use non-racy method for proc entries creation (2)
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data be setup before gluing PDE to main tree. Signed-off-by: Denis V. Lunev <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Alexey Dobriyan <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Peter Osterlund <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Dmitry Torokhov <[email protected]> Cc: Neil Brown <[email protected]> Cc: Mauro Carvalho Chehab <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
1b50221738
commit
c7705f3449
12 changed files with 33 additions and 68 deletions
|
|
@ -2744,7 +2744,6 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev)
|
|||
int i;
|
||||
int ret = 0;
|
||||
char b[BDEVNAME_SIZE];
|
||||
struct proc_dir_entry *proc;
|
||||
struct block_device *bdev;
|
||||
|
||||
if (pd->pkt_dev == dev) {
|
||||
|
|
@ -2788,11 +2787,7 @@ static int pkt_new_dev(struct pktcdvd_device *pd, dev_t dev)
|
|||
goto out_mem;
|
||||
}
|
||||
|
||||
proc = create_proc_entry(pd->name, 0, pkt_proc);
|
||||
if (proc) {
|
||||
proc->data = pd;
|
||||
proc->proc_fops = &pkt_proc_fops;
|
||||
}
|
||||
proc_create_data(pd->name, 0, pkt_proc, &pkt_proc_fops, pd);
|
||||
DPRINTK(DRIVER_NAME": writer %s mapped to %s\n", pd->name, bdevname(bdev, b));
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue