Commit a9b12619f7b6f19c871437ec24a088787a04b1de
1 parent
91bd418fdc
Exists in
master
and in
7 other branches
device create: misc: convert device_create_drvdata to device_create
Now that device_create() has been audited, rename things back to the original call to be sane. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 18 changed files with 39 additions and 49 deletions Side-by-side Diff
- arch/mips/kernel/rtlx.c
- arch/mips/sibyte/common/sb_tbprof.c
- arch/x86/kernel/cpuid.c
- arch/x86/kernel/msr.c
- drivers/dca/dca-sysfs.c
- drivers/hid/hidraw.c
- drivers/hwmon/hwmon.c
- drivers/i2c/i2c-dev.c
- drivers/isdn/capi/capi.c
- drivers/leds/led-class.c
- drivers/macintosh/adb.c
- drivers/media/dvb/dvb-core/dvbdev.c
- drivers/misc/phantom.c
- drivers/mtd/mtdchar.c
- drivers/power/power_supply_core.c
- drivers/spi/spidev.c
- drivers/uio/uio.c
- fs/coda/psdev.c
arch/mips/kernel/rtlx.c
... | ... | @@ -522,8 +522,8 @@ |
522 | 522 | atomic_set(&channel_wqs[i].in_open, 0); |
523 | 523 | mutex_init(&channel_wqs[i].mutex); |
524 | 524 | |
525 | - dev = device_create_drvdata(mt_class, NULL, MKDEV(major, i), | |
526 | - NULL, "%s%d", module_name, i); | |
525 | + dev = device_create(mt_class, NULL, MKDEV(major, i), NULL, | |
526 | + "%s%d", module_name, i); | |
527 | 527 | if (IS_ERR(dev)) { |
528 | 528 | err = PTR_ERR(dev); |
529 | 529 | goto out_chrdev; |
arch/mips/sibyte/common/sb_tbprof.c
... | ... | @@ -576,8 +576,7 @@ |
576 | 576 | |
577 | 577 | tb_class = tbc; |
578 | 578 | |
579 | - dev = device_create_drvdata(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0), | |
580 | - NULL, "tb"); | |
579 | + dev = device_create(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0), NULL, "tb"); | |
581 | 580 | if (IS_ERR(dev)) { |
582 | 581 | err = PTR_ERR(dev); |
583 | 582 | goto out_class; |
arch/x86/kernel/cpuid.c
... | ... | @@ -147,8 +147,8 @@ |
147 | 147 | { |
148 | 148 | struct device *dev; |
149 | 149 | |
150 | - dev = device_create_drvdata(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu), | |
151 | - NULL, "cpu%d", cpu); | |
150 | + dev = device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu), NULL, | |
151 | + "cpu%d", cpu); | |
152 | 152 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; |
153 | 153 | } |
154 | 154 |
arch/x86/kernel/msr.c
... | ... | @@ -163,8 +163,8 @@ |
163 | 163 | { |
164 | 164 | struct device *dev; |
165 | 165 | |
166 | - dev = device_create_drvdata(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), | |
167 | - NULL, "msr%d", cpu); | |
166 | + dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), NULL, | |
167 | + "msr%d", cpu); | |
168 | 168 | return IS_ERR(dev) ? PTR_ERR(dev) : 0; |
169 | 169 | } |
170 | 170 |
drivers/dca/dca-sysfs.c
... | ... | @@ -15,9 +15,8 @@ |
15 | 15 | struct device *cd; |
16 | 16 | static int req_count; |
17 | 17 | |
18 | - cd = device_create_drvdata(dca_class, dca->cd, | |
19 | - MKDEV(0, slot + 1), NULL, | |
20 | - "requester%d", req_count++); | |
18 | + cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), NULL, | |
19 | + "requester%d", req_count++); | |
21 | 20 | if (IS_ERR(cd)) |
22 | 21 | return PTR_ERR(cd); |
23 | 22 | return 0; |
... | ... | @@ -48,8 +47,7 @@ |
48 | 47 | return err; |
49 | 48 | } |
50 | 49 | |
51 | - cd = device_create_drvdata(dca_class, dev, MKDEV(0, 0), NULL, | |
52 | - "dca%d", dca->id); | |
50 | + cd = device_create(dca_class, dev, MKDEV(0, 0), NULL, "dca%d", dca->id); | |
53 | 51 | if (IS_ERR(cd)) { |
54 | 52 | spin_lock(&dca_idr_lock); |
55 | 53 | idr_remove(&dca_idr, dca->id); |
drivers/hid/hidraw.c
... | ... | @@ -326,9 +326,8 @@ |
326 | 326 | goto out; |
327 | 327 | } |
328 | 328 | |
329 | - dev->dev = device_create_drvdata(hidraw_class, NULL, | |
330 | - MKDEV(hidraw_major, minor), NULL, | |
331 | - "%s%d", "hidraw", minor); | |
329 | + dev->dev = device_create(hidraw_class, NULL, MKDEV(hidraw_major, minor), | |
330 | + NULL, "%s%d", "hidraw", minor); | |
332 | 331 | |
333 | 332 | if (IS_ERR(dev->dev)) { |
334 | 333 | spin_lock(&minors_lock); |
drivers/hwmon/hwmon.c
... | ... | @@ -55,8 +55,8 @@ |
55 | 55 | return ERR_PTR(err); |
56 | 56 | |
57 | 57 | id = id & MAX_ID_MASK; |
58 | - hwdev = device_create_drvdata(hwmon_class, dev, MKDEV(0, 0), NULL, | |
59 | - HWMON_ID_FORMAT, id); | |
58 | + hwdev = device_create(hwmon_class, dev, MKDEV(0, 0), NULL, | |
59 | + HWMON_ID_FORMAT, id); | |
60 | 60 | |
61 | 61 | if (IS_ERR(hwdev)) { |
62 | 62 | spin_lock(&idr_lock); |
drivers/i2c/i2c-dev.c
... | ... | @@ -521,9 +521,9 @@ |
521 | 521 | return PTR_ERR(i2c_dev); |
522 | 522 | |
523 | 523 | /* register this i2c device with the driver core */ |
524 | - i2c_dev->dev = device_create_drvdata(i2c_dev_class, &adap->dev, | |
525 | - MKDEV(I2C_MAJOR, adap->nr), | |
526 | - NULL, "i2c-%d", adap->nr); | |
524 | + i2c_dev->dev = device_create(i2c_dev_class, &adap->dev, | |
525 | + MKDEV(I2C_MAJOR, adap->nr), NULL, | |
526 | + "i2c-%d", adap->nr); | |
527 | 527 | if (IS_ERR(i2c_dev->dev)) { |
528 | 528 | res = PTR_ERR(i2c_dev->dev); |
529 | 529 | goto error; |
drivers/isdn/capi/capi.c
... | ... | @@ -1553,8 +1553,7 @@ |
1553 | 1553 | return PTR_ERR(capi_class); |
1554 | 1554 | } |
1555 | 1555 | |
1556 | - device_create_drvdata(capi_class, NULL, MKDEV(capi_major, 0), NULL, | |
1557 | - "capi"); | |
1556 | + device_create(capi_class, NULL, MKDEV(capi_major, 0), NULL, "capi"); | |
1558 | 1557 | |
1559 | 1558 | #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE |
1560 | 1559 | if (capinc_tty_init() < 0) { |
drivers/leds/led-class.c
... | ... | @@ -103,8 +103,8 @@ |
103 | 103 | { |
104 | 104 | int rc; |
105 | 105 | |
106 | - led_cdev->dev = device_create_drvdata(leds_class, parent, 0, led_cdev, | |
107 | - "%s", led_cdev->name); | |
106 | + led_cdev->dev = device_create(leds_class, parent, 0, led_cdev, | |
107 | + "%s", led_cdev->name); | |
108 | 108 | if (IS_ERR(led_cdev->dev)) |
109 | 109 | return PTR_ERR(led_cdev->dev); |
110 | 110 |
drivers/macintosh/adb.c
... | ... | @@ -862,8 +862,7 @@ |
862 | 862 | adb_dev_class = class_create(THIS_MODULE, "adb"); |
863 | 863 | if (IS_ERR(adb_dev_class)) |
864 | 864 | return; |
865 | - device_create_drvdata(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, | |
866 | - "adb"); | |
865 | + device_create(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, "adb"); | |
867 | 866 | |
868 | 867 | platform_device_register(&adb_pfdev); |
869 | 868 | platform_driver_probe(&adb_pfdrv, adb_dummy_probe); |
drivers/media/dvb/dvb-core/dvbdev.c
... | ... | @@ -233,7 +233,7 @@ |
233 | 233 | |
234 | 234 | mutex_unlock(&dvbdev_register_lock); |
235 | 235 | |
236 | - clsdev = device_create_drvdata(dvb_class, adap->device, | |
236 | + clsdev = device_create(dvb_class, adap->device, | |
237 | 237 | MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), |
238 | 238 | NULL, "dvb%d.%s%d", adap->num, dnames[type], id); |
239 | 239 | if (IS_ERR(clsdev)) { |
drivers/misc/phantom.c
... | ... | @@ -399,9 +399,9 @@ |
399 | 399 | goto err_irq; |
400 | 400 | } |
401 | 401 | |
402 | - if (IS_ERR(device_create_drvdata(phantom_class, &pdev->dev, | |
403 | - MKDEV(phantom_major, minor), | |
404 | - NULL, "phantom%u", minor))) | |
402 | + if (IS_ERR(device_create(phantom_class, &pdev->dev, | |
403 | + MKDEV(phantom_major, minor), NULL, | |
404 | + "phantom%u", minor))) | |
405 | 405 | dev_err(&pdev->dev, "can't create device\n"); |
406 | 406 | |
407 | 407 | pci_set_drvdata(pdev, pht); |
drivers/mtd/mtdchar.c
... | ... | @@ -26,13 +26,11 @@ |
26 | 26 | if (!mtd) |
27 | 27 | return; |
28 | 28 | |
29 | - device_create_drvdata(mtd_class, NULL, | |
30 | - MKDEV(MTD_CHAR_MAJOR, mtd->index*2), | |
31 | - NULL, "mtd%d", mtd->index); | |
29 | + device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2), | |
30 | + NULL, "mtd%d", mtd->index); | |
32 | 31 | |
33 | - device_create_drvdata(mtd_class, NULL, | |
34 | - MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1), | |
35 | - NULL, "mtd%dro", mtd->index); | |
32 | + device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1), | |
33 | + NULL, "mtd%dro", mtd->index); | |
36 | 34 | } |
37 | 35 | |
38 | 36 | static void mtd_notify_remove(struct mtd_info* mtd) |
drivers/power/power_supply_core.c
... | ... | @@ -91,8 +91,8 @@ |
91 | 91 | { |
92 | 92 | int rc = 0; |
93 | 93 | |
94 | - psy->dev = device_create_drvdata(power_supply_class, parent, 0, | |
95 | - psy, "%s", psy->name); | |
94 | + psy->dev = device_create(power_supply_class, parent, 0, psy, | |
95 | + "%s", psy->name); | |
96 | 96 | if (IS_ERR(psy->dev)) { |
97 | 97 | rc = PTR_ERR(psy->dev); |
98 | 98 | goto dev_create_failed; |
drivers/spi/spidev.c
... | ... | @@ -583,10 +583,9 @@ |
583 | 583 | struct device *dev; |
584 | 584 | |
585 | 585 | spidev->devt = MKDEV(SPIDEV_MAJOR, minor); |
586 | - dev = device_create_drvdata(spidev_class, &spi->dev, | |
587 | - spidev->devt, spidev, | |
588 | - "spidev%d.%d", | |
589 | - spi->master->bus_num, spi->chip_select); | |
586 | + dev = device_create(spidev_class, &spi->dev, spidev->devt, | |
587 | + spidev, "spidev%d.%d", | |
588 | + spi->master->bus_num, spi->chip_select); | |
590 | 589 | status = IS_ERR(dev) ? PTR_ERR(dev) : 0; |
591 | 590 | } else { |
592 | 591 | dev_dbg(&spi->dev, "no minor number available!\n"); |
drivers/uio/uio.c
... | ... | @@ -682,9 +682,9 @@ |
682 | 682 | if (ret) |
683 | 683 | goto err_get_minor; |
684 | 684 | |
685 | - idev->dev = device_create_drvdata(uio_class->class, parent, | |
686 | - MKDEV(uio_major, idev->minor), idev, | |
687 | - "uio%d", idev->minor); | |
685 | + idev->dev = device_create(uio_class->class, parent, | |
686 | + MKDEV(uio_major, idev->minor), idev, | |
687 | + "uio%d", idev->minor); | |
688 | 688 | if (IS_ERR(idev->dev)) { |
689 | 689 | printk(KERN_ERR "UIO: device register failed\n"); |
690 | 690 | ret = PTR_ERR(idev->dev); |
fs/coda/psdev.c
... | ... | @@ -362,9 +362,8 @@ |
362 | 362 | goto out_chrdev; |
363 | 363 | } |
364 | 364 | for (i = 0; i < MAX_CODADEVS; i++) |
365 | - device_create_drvdata(coda_psdev_class, NULL, | |
366 | - MKDEV(CODA_PSDEV_MAJOR, i), | |
367 | - NULL, "cfs%d", i); | |
365 | + device_create(coda_psdev_class, NULL, | |
366 | + MKDEV(CODA_PSDEV_MAJOR, i), NULL, "cfs%d", i); | |
368 | 367 | coda_sysctl_init(); |
369 | 368 | goto out; |
370 | 369 |