aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-07-21 23:03:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-16 12:24:43 -0400
commita9b12619f7b6f19c871437ec24a088787a04b1de (patch)
treeff1b11e7affedccfd69fc20e14876d0821f6e555
parent91bd418fdc8526ee70a0e8f7970b584c8870ae10 (diff)
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>
-rw-r--r--arch/mips/kernel/rtlx.c4
-rw-r--r--arch/mips/sibyte/common/sb_tbprof.c3
-rw-r--r--arch/x86/kernel/cpuid.c4
-rw-r--r--arch/x86/kernel/msr.c4
-rw-r--r--drivers/dca/dca-sysfs.c8
-rw-r--r--drivers/hid/hidraw.c5
-rw-r--r--drivers/hwmon/hwmon.c4
-rw-r--r--drivers/i2c/i2c-dev.c6
-rw-r--r--drivers/isdn/capi/capi.c3
-rw-r--r--drivers/leds/led-class.c4
-rw-r--r--drivers/macintosh/adb.c3
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c2
-rw-r--r--drivers/misc/phantom.c6
-rw-r--r--drivers/mtd/mtdchar.c10
-rw-r--r--drivers/power/power_supply_core.c4
-rw-r--r--drivers/spi/spidev.c7
-rw-r--r--drivers/uio/uio.c6
-rw-r--r--fs/coda/psdev.c5
18 files changed, 39 insertions, 49 deletions
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index dfd868b68364..4ce93aa7b372 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -522,8 +522,8 @@ static int __init rtlx_module_init(void)
522 atomic_set(&channel_wqs[i].in_open, 0); 522 atomic_set(&channel_wqs[i].in_open, 0);
523 mutex_init(&channel_wqs[i].mutex); 523 mutex_init(&channel_wqs[i].mutex);
524 524
525 dev = device_create_drvdata(mt_class, NULL, MKDEV(major, i), 525 dev = device_create(mt_class, NULL, MKDEV(major, i), NULL,
526 NULL, "%s%d", module_name, i); 526 "%s%d", module_name, i);
527 if (IS_ERR(dev)) { 527 if (IS_ERR(dev)) {
528 err = PTR_ERR(dev); 528 err = PTR_ERR(dev);
529 goto out_chrdev; 529 goto out_chrdev;
diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
index 66e3e3fb311f..637a194e5cd5 100644
--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -576,8 +576,7 @@ static int __init sbprof_tb_init(void)
576 576
577 tb_class = tbc; 577 tb_class = tbc;
578 578
579 dev = device_create_drvdata(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0), 579 dev = device_create(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0), NULL, "tb");
580 NULL, "tb");
581 if (IS_ERR(dev)) { 580 if (IS_ERR(dev)) {
582 err = PTR_ERR(dev); 581 err = PTR_ERR(dev);
583 goto out_class; 582 goto out_class;
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 6a44d6465991..72cefd1e649b 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -147,8 +147,8 @@ static __cpuinit int cpuid_device_create(int cpu)
147{ 147{
148 struct device *dev; 148 struct device *dev;
149 149
150 dev = device_create_drvdata(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu), 150 dev = device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu), NULL,
151 NULL, "cpu%d", cpu); 151 "cpu%d", cpu);
152 return IS_ERR(dev) ? PTR_ERR(dev) : 0; 152 return IS_ERR(dev) ? PTR_ERR(dev) : 0;
153} 153}
154 154
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 2e2af5d18191..82a7c7ed6d45 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -163,8 +163,8 @@ static int __cpuinit msr_device_create(int cpu)
163{ 163{
164 struct device *dev; 164 struct device *dev;
165 165
166 dev = device_create_drvdata(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), 166 dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), NULL,
167 NULL, "msr%d", cpu); 167 "msr%d", cpu);
168 return IS_ERR(dev) ? PTR_ERR(dev) : 0; 168 return IS_ERR(dev) ? PTR_ERR(dev) : 0;
169} 169}
170 170
diff --git a/drivers/dca/dca-sysfs.c b/drivers/dca/dca-sysfs.c
index 7af4b403bd2d..bb538b9690e0 100644
--- a/drivers/dca/dca-sysfs.c
+++ b/drivers/dca/dca-sysfs.c
@@ -15,9 +15,8 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot)
15 struct device *cd; 15 struct device *cd;
16 static int req_count; 16 static int req_count;
17 17
18 cd = device_create_drvdata(dca_class, dca->cd, 18 cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), NULL,
19 MKDEV(0, slot + 1), NULL, 19 "requester%d", req_count++);
20 "requester%d", req_count++);
21 if (IS_ERR(cd)) 20 if (IS_ERR(cd))
22 return PTR_ERR(cd); 21 return PTR_ERR(cd);
23 return 0; 22 return 0;
@@ -48,8 +47,7 @@ idr_try_again:
48 return err; 47 return err;
49 } 48 }
50 49
51 cd = device_create_drvdata(dca_class, dev, MKDEV(0, 0), NULL, 50 cd = device_create(dca_class, dev, MKDEV(0, 0), NULL, "dca%d", dca->id);
52 "dca%d", dca->id);
53 if (IS_ERR(cd)) { 51 if (IS_ERR(cd)) {
54 spin_lock(&dca_idr_lock); 52 spin_lock(&dca_idr_lock);
55 idr_remove(&dca_idr, dca->id); 53 idr_remove(&dca_idr, dca->id);
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 497e0d1dd3c3..af3edb98df43 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -326,9 +326,8 @@ int hidraw_connect(struct hid_device *hid)
326 goto out; 326 goto out;
327 } 327 }
328 328
329 dev->dev = device_create_drvdata(hidraw_class, NULL, 329 dev->dev = device_create(hidraw_class, NULL, MKDEV(hidraw_major, minor),
330 MKDEV(hidraw_major, minor), NULL, 330 NULL, "%s%d", "hidraw", minor);
331 "%s%d", "hidraw", minor);
332 331
333 if (IS_ERR(dev->dev)) { 332 if (IS_ERR(dev->dev)) {
334 spin_lock(&minors_lock); 333 spin_lock(&minors_lock);
diff --git a/drivers/hwmon/hwmon.c b/drivers/hwmon/hwmon.c
index 7321a88a5112..076a59cdabe9 100644
--- a/drivers/hwmon/hwmon.c
+++ b/drivers/hwmon/hwmon.c
@@ -55,8 +55,8 @@ again:
55 return ERR_PTR(err); 55 return ERR_PTR(err);
56 56
57 id = id & MAX_ID_MASK; 57 id = id & MAX_ID_MASK;
58 hwdev = device_create_drvdata(hwmon_class, dev, MKDEV(0, 0), NULL, 58 hwdev = device_create(hwmon_class, dev, MKDEV(0, 0), NULL,
59 HWMON_ID_FORMAT, id); 59 HWMON_ID_FORMAT, id);
60 60
61 if (IS_ERR(hwdev)) { 61 if (IS_ERR(hwdev)) {
62 spin_lock(&idr_lock); 62 spin_lock(&idr_lock);
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 307d976c9b69..c171988a9f51 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -521,9 +521,9 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap)
521 return PTR_ERR(i2c_dev); 521 return PTR_ERR(i2c_dev);
522 522
523 /* register this i2c device with the driver core */ 523 /* register this i2c device with the driver core */
524 i2c_dev->dev = device_create_drvdata(i2c_dev_class, &adap->dev, 524 i2c_dev->dev = device_create(i2c_dev_class, &adap->dev,
525 MKDEV(I2C_MAJOR, adap->nr), 525 MKDEV(I2C_MAJOR, adap->nr), NULL,
526 NULL, "i2c-%d", adap->nr); 526 "i2c-%d", adap->nr);
527 if (IS_ERR(i2c_dev->dev)) { 527 if (IS_ERR(i2c_dev->dev)) {
528 res = PTR_ERR(i2c_dev->dev); 528 res = PTR_ERR(i2c_dev->dev);
529 goto error; 529 goto error;
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 798d7f3e42ef..1b5bf87c4cf4 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -1553,8 +1553,7 @@ static int __init capi_init(void)
1553 return PTR_ERR(capi_class); 1553 return PTR_ERR(capi_class);
1554 } 1554 }
1555 1555
1556 device_create_drvdata(capi_class, NULL, MKDEV(capi_major, 0), NULL, 1556 device_create(capi_class, NULL, MKDEV(capi_major, 0), NULL, "capi");
1557 "capi");
1558 1557
1559#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE 1558#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
1560 if (capinc_tty_init() < 0) { 1559 if (capinc_tty_init() < 0) {
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 559a40861c39..ee74ee7b2acc 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -103,8 +103,8 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
103{ 103{
104 int rc; 104 int rc;
105 105
106 led_cdev->dev = device_create_drvdata(leds_class, parent, 0, led_cdev, 106 led_cdev->dev = device_create(leds_class, parent, 0, led_cdev,
107 "%s", led_cdev->name); 107 "%s", led_cdev->name);
108 if (IS_ERR(led_cdev->dev)) 108 if (IS_ERR(led_cdev->dev))
109 return PTR_ERR(led_cdev->dev); 109 return PTR_ERR(led_cdev->dev);
110 110
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index cae52485208a..23741cec45e3 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -862,8 +862,7 @@ adbdev_init(void)
862 adb_dev_class = class_create(THIS_MODULE, "adb"); 862 adb_dev_class = class_create(THIS_MODULE, "adb");
863 if (IS_ERR(adb_dev_class)) 863 if (IS_ERR(adb_dev_class))
864 return; 864 return;
865 device_create_drvdata(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, 865 device_create(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, "adb");
866 "adb");
867 866
868 platform_device_register(&adb_pfdev); 867 platform_device_register(&adb_pfdev);
869 platform_driver_probe(&adb_pfdrv, adb_dummy_probe); 868 platform_driver_probe(&adb_pfdrv, adb_dummy_probe);
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index e7132770a3bf..665776d72a48 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -233,7 +233,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
233 233
234 mutex_unlock(&dvbdev_register_lock); 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 MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), 237 MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
238 NULL, "dvb%d.%s%d", adap->num, dnames[type], id); 238 NULL, "dvb%d.%s%d", adap->num, dnames[type], id);
239 if (IS_ERR(clsdev)) { 239 if (IS_ERR(clsdev)) {
diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
index daf585689ce3..abdebe347383 100644
--- a/drivers/misc/phantom.c
+++ b/drivers/misc/phantom.c
@@ -399,9 +399,9 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
399 goto err_irq; 399 goto err_irq;
400 } 400 }
401 401
402 if (IS_ERR(device_create_drvdata(phantom_class, &pdev->dev, 402 if (IS_ERR(device_create(phantom_class, &pdev->dev,
403 MKDEV(phantom_major, minor), 403 MKDEV(phantom_major, minor), NULL,
404 NULL, "phantom%u", minor))) 404 "phantom%u", minor)))
405 dev_err(&pdev->dev, "can't create device\n"); 405 dev_err(&pdev->dev, "can't create device\n");
406 406
407 pci_set_drvdata(pdev, pht); 407 pci_set_drvdata(pdev, pht);
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index e00d424e6575..1c74762dec89 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -26,13 +26,11 @@ static void mtd_notify_add(struct mtd_info* mtd)
26 if (!mtd) 26 if (!mtd)
27 return; 27 return;
28 28
29 device_create_drvdata(mtd_class, NULL, 29 device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
30 MKDEV(MTD_CHAR_MAJOR, mtd->index*2), 30 NULL, "mtd%d", mtd->index);
31 NULL, "mtd%d", mtd->index);
32 31
33 device_create_drvdata(mtd_class, NULL, 32 device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
34 MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1), 33 NULL, "mtd%dro", mtd->index);
35 NULL, "mtd%dro", mtd->index);
36} 34}
37 35
38static void mtd_notify_remove(struct mtd_info* mtd) 36static void mtd_notify_remove(struct mtd_info* mtd)
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index cb1ccb472921..3007695f90c8 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -91,8 +91,8 @@ int power_supply_register(struct device *parent, struct power_supply *psy)
91{ 91{
92 int rc = 0; 92 int rc = 0;
93 93
94 psy->dev = device_create_drvdata(power_supply_class, parent, 0, 94 psy->dev = device_create(power_supply_class, parent, 0, psy,
95 psy, "%s", psy->name); 95 "%s", psy->name);
96 if (IS_ERR(psy->dev)) { 96 if (IS_ERR(psy->dev)) {
97 rc = PTR_ERR(psy->dev); 97 rc = PTR_ERR(psy->dev);
98 goto dev_create_failed; 98 goto dev_create_failed;
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index e5e0cfed5e3b..89a43755a453 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -583,10 +583,9 @@ static int spidev_probe(struct spi_device *spi)
583 struct device *dev; 583 struct device *dev;
584 584
585 spidev->devt = MKDEV(SPIDEV_MAJOR, minor); 585 spidev->devt = MKDEV(SPIDEV_MAJOR, minor);
586 dev = device_create_drvdata(spidev_class, &spi->dev, 586 dev = device_create(spidev_class, &spi->dev, spidev->devt,
587 spidev->devt, spidev, 587 spidev, "spidev%d.%d",
588 "spidev%d.%d", 588 spi->master->bus_num, spi->chip_select);
589 spi->master->bus_num, spi->chip_select);
590 status = IS_ERR(dev) ? PTR_ERR(dev) : 0; 589 status = IS_ERR(dev) ? PTR_ERR(dev) : 0;
591 } else { 590 } else {
592 dev_dbg(&spi->dev, "no minor number available!\n"); 591 dev_dbg(&spi->dev, "no minor number available!\n");
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 3a6934bf7131..9ac22c7c3854 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -682,9 +682,9 @@ int __uio_register_device(struct module *owner,
682 if (ret) 682 if (ret)
683 goto err_get_minor; 683 goto err_get_minor;
684 684
685 idev->dev = device_create_drvdata(uio_class->class, parent, 685 idev->dev = device_create(uio_class->class, parent,
686 MKDEV(uio_major, idev->minor), idev, 686 MKDEV(uio_major, idev->minor), idev,
687 "uio%d", idev->minor); 687 "uio%d", idev->minor);
688 if (IS_ERR(idev->dev)) { 688 if (IS_ERR(idev->dev)) {
689 printk(KERN_ERR "UIO: device register failed\n"); 689 printk(KERN_ERR "UIO: device register failed\n");
690 ret = PTR_ERR(idev->dev); 690 ret = PTR_ERR(idev->dev);
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index 0d9b80ec689c..cfd29da714d1 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -362,9 +362,8 @@ static int init_coda_psdev(void)
362 goto out_chrdev; 362 goto out_chrdev;
363 } 363 }
364 for (i = 0; i < MAX_CODADEVS; i++) 364 for (i = 0; i < MAX_CODADEVS; i++)
365 device_create_drvdata(coda_psdev_class, NULL, 365 device_create(coda_psdev_class, NULL,
366 MKDEV(CODA_PSDEV_MAJOR, i), 366 MKDEV(CODA_PSDEV_MAJOR, i), NULL, "cfs%d", i);
367 NULL, "cfs%d", i);
368 coda_sysctl_init(); 367 coda_sysctl_init();
369 goto out; 368 goto out;
370 369