device create: misc: convert device_create_drvdata to device_create
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 22 Jul 2008 03:03:34 +0000 (20:03 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 16 Oct 2008 16:24:43 +0000 (09:24 -0700)
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>
18 files changed:
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

index dfd868b683640634f7d128f883f53165b73595fb..4ce93aa7b37259f24299791a7a793230de5a79a6 100644 (file)
@@ -522,8 +522,8 @@ static int __init rtlx_module_init(void)
                atomic_set(&channel_wqs[i].in_open, 0);
                mutex_init(&channel_wqs[i].mutex);
 
-               dev = device_create_drvdata(mt_class, NULL, MKDEV(major, i),
-                                           NULL, "%s%d", module_name, i);
+               dev = device_create(mt_class, NULL, MKDEV(major, i), NULL,
+                                   "%s%d", module_name, i);
                if (IS_ERR(dev)) {
                        err = PTR_ERR(dev);
                        goto out_chrdev;
index 66e3e3fb311f9a413ffb3dbc58aa9174fe101fe5..637a194e5cd5f95e0ee2de2687ddbab05ac45cec 100644 (file)
@@ -576,8 +576,7 @@ static int __init sbprof_tb_init(void)
 
        tb_class = tbc;
 
-       dev = device_create_drvdata(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0),
-                                   NULL, "tb");
+       dev = device_create(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0), NULL, "tb");
        if (IS_ERR(dev)) {
                err = PTR_ERR(dev);
                goto out_class;
index 6a44d646599156cc5910cce8f503832688c973a5..72cefd1e649ba4be254b5ec497f442160dab1752 100644 (file)
@@ -147,8 +147,8 @@ static __cpuinit int cpuid_device_create(int cpu)
 {
        struct device *dev;
 
-       dev = device_create_drvdata(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu),
-                                   NULL, "cpu%d", cpu);
+       dev = device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu), NULL,
+                           "cpu%d", cpu);
        return IS_ERR(dev) ? PTR_ERR(dev) : 0;
 }
 
index 2e2af5d1819160c6047b82a06b6f141e5a23f39c..82a7c7ed6d456401ef1776a53030a4db7890443e 100644 (file)
@@ -163,8 +163,8 @@ static int __cpuinit msr_device_create(int cpu)
 {
        struct device *dev;
 
-       dev = device_create_drvdata(msr_class, NULL, MKDEV(MSR_MAJOR, cpu),
-                                   NULL, "msr%d", cpu);
+       dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), NULL,
+                           "msr%d", cpu);
        return IS_ERR(dev) ? PTR_ERR(dev) : 0;
 }
 
index 7af4b403bd2d12a6f3219f8f8d6615f5de69def1..bb538b9690e08186ae6c7d73240901b95b6b9ee3 100644 (file)
@@ -15,9 +15,8 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot)
        struct device *cd;
        static int req_count;
 
-       cd = device_create_drvdata(dca_class, dca->cd,
-                                  MKDEV(0, slot + 1), NULL,
-                                  "requester%d", req_count++);
+       cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), NULL,
+                          "requester%d", req_count++);
        if (IS_ERR(cd))
                return PTR_ERR(cd);
        return 0;
@@ -48,8 +47,7 @@ idr_try_again:
                return err;
        }
 
-       cd = device_create_drvdata(dca_class, dev, MKDEV(0, 0), NULL,
-                                  "dca%d", dca->id);
+       cd = device_create(dca_class, dev, MKDEV(0, 0), NULL, "dca%d", dca->id);
        if (IS_ERR(cd)) {
                spin_lock(&dca_idr_lock);
                idr_remove(&dca_idr, dca->id);
index 497e0d1dd3c374c7f65129a487f11bb4c807364a..af3edb98df435f2c3fa22fde81350d4f15dcd286 100644 (file)
@@ -326,9 +326,8 @@ int hidraw_connect(struct hid_device *hid)
                goto out;
        }
 
-       dev->dev = device_create_drvdata(hidraw_class, NULL,
-                                        MKDEV(hidraw_major, minor), NULL,
-                                        "%s%d", "hidraw", minor);
+       dev->dev = device_create(hidraw_class, NULL, MKDEV(hidraw_major, minor),
+                                NULL, "%s%d", "hidraw", minor);
 
        if (IS_ERR(dev->dev)) {
                spin_lock(&minors_lock);
index 7321a88a51128adef8ba40016e03f0648b7e4a97..076a59cdabe9f7a205cedd3883d40416e2e9b9c7 100644 (file)
@@ -55,8 +55,8 @@ again:
                return ERR_PTR(err);
 
        id = id & MAX_ID_MASK;
-       hwdev = device_create_drvdata(hwmon_class, dev, MKDEV(0, 0), NULL,
-                                     HWMON_ID_FORMAT, id);
+       hwdev = device_create(hwmon_class, dev, MKDEV(0, 0), NULL,
+                             HWMON_ID_FORMAT, id);
 
        if (IS_ERR(hwdev)) {
                spin_lock(&idr_lock);
index 307d976c9b69b977c389e62abfbe43682b1d3e24..c171988a9f517d7009319674265c47a10859a8c3 100644 (file)
@@ -521,9 +521,9 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap)
                return PTR_ERR(i2c_dev);
 
        /* register this i2c device with the driver core */
-       i2c_dev->dev = device_create_drvdata(i2c_dev_class, &adap->dev,
-                                            MKDEV(I2C_MAJOR, adap->nr),
-                                            NULL, "i2c-%d", adap->nr);
+       i2c_dev->dev = device_create(i2c_dev_class, &adap->dev,
+                                    MKDEV(I2C_MAJOR, adap->nr), NULL,
+                                    "i2c-%d", adap->nr);
        if (IS_ERR(i2c_dev->dev)) {
                res = PTR_ERR(i2c_dev->dev);
                goto error;
index 798d7f3e42efbcaad5e871b0590a6cc77933fbc1..1b5bf87c4cf4719cd66e75575d3b97250e368e06 100644 (file)
@@ -1553,8 +1553,7 @@ static int __init capi_init(void)
                return PTR_ERR(capi_class);
        }
 
-       device_create_drvdata(capi_class, NULL, MKDEV(capi_major, 0), NULL,
-                             "capi");
+       device_create(capi_class, NULL, MKDEV(capi_major, 0), NULL, "capi");
 
 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
        if (capinc_tty_init() < 0) {
index 559a40861c39b2e8e8fd7531acb06dc00a20dde2..ee74ee7b2accab837fc43c0c8cda523795bed5ce 100644 (file)
@@ -103,8 +103,8 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
 {
        int rc;
 
-       led_cdev->dev = device_create_drvdata(leds_class, parent, 0, led_cdev,
-                                             "%s", led_cdev->name);
+       led_cdev->dev = device_create(leds_class, parent, 0, led_cdev,
+                                     "%s", led_cdev->name);
        if (IS_ERR(led_cdev->dev))
                return PTR_ERR(led_cdev->dev);
 
index cae52485208aaf022bd57689dcf8a4b30173aa2e..23741cec45e3e43210fdbac7e11c6ecc9c4eb1d5 100644 (file)
@@ -862,8 +862,7 @@ adbdev_init(void)
        adb_dev_class = class_create(THIS_MODULE, "adb");
        if (IS_ERR(adb_dev_class))
                return;
-       device_create_drvdata(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL,
-                             "adb");
+       device_create(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, "adb");
 
        platform_device_register(&adb_pfdev);
        platform_driver_probe(&adb_pfdrv, adb_dummy_probe);
index e7132770a3bfdd656117890d11ff4ee6c9195302..665776d72a48c0456b712b25894760e60f48e4e8 100644 (file)
@@ -233,7 +233,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
 
        mutex_unlock(&dvbdev_register_lock);
 
-       clsdev = device_create_drvdata(dvb_class, adap->device,
+       clsdev = device_create(dvb_class, adap->device,
                               MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
                               NULL, "dvb%d.%s%d", adap->num, dnames[type], id);
        if (IS_ERR(clsdev)) {
index daf585689ce33a0e77a07bd3991e2165f8c04acb..abdebe347383903d93f43e59365a76ef2b6db48f 100644 (file)
@@ -399,9 +399,9 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
                goto err_irq;
        }
 
-       if (IS_ERR(device_create_drvdata(phantom_class, &pdev->dev,
-                                        MKDEV(phantom_major, minor),
-                                        NULL, "phantom%u", minor)))
+       if (IS_ERR(device_create(phantom_class, &pdev->dev,
+                                MKDEV(phantom_major, minor), NULL,
+                                "phantom%u", minor)))
                dev_err(&pdev->dev, "can't create device\n");
 
        pci_set_drvdata(pdev, pht);
index e00d424e6575da02ed20246b44c6545c1cbe8b34..1c74762dec89c25f73c3d7ab7fa4fbdaf2e08688 100644 (file)
@@ -26,13 +26,11 @@ static void mtd_notify_add(struct mtd_info* mtd)
        if (!mtd)
                return;
 
-       device_create_drvdata(mtd_class, NULL,
-                             MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
-                             NULL, "mtd%d", mtd->index);
+       device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
+                     NULL, "mtd%d", mtd->index);
 
-       device_create_drvdata(mtd_class, NULL,
-                             MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
-                             NULL, "mtd%dro", mtd->index);
+       device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
+                     NULL, "mtd%dro", mtd->index);
 }
 
 static void mtd_notify_remove(struct mtd_info* mtd)
index cb1ccb4729210c1a3cfd8901bf7dea5c56117146..3007695f90c822e067a31e3c44da67d4598ff2e7 100644 (file)
@@ -91,8 +91,8 @@ int power_supply_register(struct device *parent, struct power_supply *psy)
 {
        int rc = 0;
 
-       psy->dev = device_create_drvdata(power_supply_class, parent, 0,
-                                        psy, "%s", psy->name);
+       psy->dev = device_create(power_supply_class, parent, 0, psy,
+                                "%s", psy->name);
        if (IS_ERR(psy->dev)) {
                rc = PTR_ERR(psy->dev);
                goto dev_create_failed;
index e5e0cfed5e3b3fedff7f81983a73f4b94a9de8ca..89a43755a453bb265ebfa789adca222a8cce1ebe 100644 (file)
@@ -583,10 +583,9 @@ static int spidev_probe(struct spi_device *spi)
                struct device *dev;
 
                spidev->devt = MKDEV(SPIDEV_MAJOR, minor);
-               dev = device_create_drvdata(spidev_class, &spi->dev,
-                               spidev->devt, spidev,
-                               "spidev%d.%d",
-                               spi->master->bus_num, spi->chip_select);
+               dev = device_create(spidev_class, &spi->dev, spidev->devt,
+                                   spidev, "spidev%d.%d",
+                                   spi->master->bus_num, spi->chip_select);
                status = IS_ERR(dev) ? PTR_ERR(dev) : 0;
        } else {
                dev_dbg(&spi->dev, "no minor number available!\n");
index 3a6934bf713134edc3f53b68e25bf913ec3215e4..9ac22c7c385487e212d8c46fbfab56d12fc7c860 100644 (file)
@@ -682,9 +682,9 @@ int __uio_register_device(struct module *owner,
        if (ret)
                goto err_get_minor;
 
-       idev->dev = device_create_drvdata(uio_class->class, parent,
-                                         MKDEV(uio_major, idev->minor), idev,
-                                         "uio%d", idev->minor);
+       idev->dev = device_create(uio_class->class, parent,
+                                 MKDEV(uio_major, idev->minor), idev,
+                                 "uio%d", idev->minor);
        if (IS_ERR(idev->dev)) {
                printk(KERN_ERR "UIO: device register failed\n");
                ret = PTR_ERR(idev->dev);
index 0d9b80ec689ccc0741fee358d92f26b34f1bc4c9..cfd29da714d1e9bf9b9f41338c09723ff09422de 100644 (file)
@@ -362,9 +362,8 @@ static int init_coda_psdev(void)
                goto out_chrdev;
        }               
        for (i = 0; i < MAX_CODADEVS; i++)
-               device_create_drvdata(coda_psdev_class, NULL,
-                                     MKDEV(CODA_PSDEV_MAJOR, i),
-                                     NULL, "cfs%d", i);
+               device_create(coda_psdev_class, NULL,
+                             MKDEV(CODA_PSDEV_MAJOR, i), NULL, "cfs%d", i);
        coda_sysctl_init();
        goto out;