提交 a9b12619 编写于 作者: G Greg Kroah-Hartman

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: NGreg Kroah-Hartman <gregkh@suse.de>
上级 91bd418f
...@@ -522,8 +522,8 @@ static int __init rtlx_module_init(void) ...@@ -522,8 +522,8 @@ static int __init rtlx_module_init(void)
atomic_set(&channel_wqs[i].in_open, 0); atomic_set(&channel_wqs[i].in_open, 0);
mutex_init(&channel_wqs[i].mutex); mutex_init(&channel_wqs[i].mutex);
dev = device_create_drvdata(mt_class, NULL, MKDEV(major, i), dev = device_create(mt_class, NULL, MKDEV(major, i), NULL,
NULL, "%s%d", module_name, i); "%s%d", module_name, i);
if (IS_ERR(dev)) { if (IS_ERR(dev)) {
err = PTR_ERR(dev); err = PTR_ERR(dev);
goto out_chrdev; goto out_chrdev;
......
...@@ -576,8 +576,7 @@ static int __init sbprof_tb_init(void) ...@@ -576,8 +576,7 @@ static int __init sbprof_tb_init(void)
tb_class = tbc; tb_class = tbc;
dev = device_create_drvdata(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0), dev = device_create(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0), NULL, "tb");
NULL, "tb");
if (IS_ERR(dev)) { if (IS_ERR(dev)) {
err = PTR_ERR(dev); err = PTR_ERR(dev);
goto out_class; goto out_class;
......
...@@ -147,8 +147,8 @@ static __cpuinit int cpuid_device_create(int cpu) ...@@ -147,8 +147,8 @@ static __cpuinit int cpuid_device_create(int cpu)
{ {
struct device *dev; struct device *dev;
dev = device_create_drvdata(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu), dev = device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu), NULL,
NULL, "cpu%d", cpu); "cpu%d", cpu);
return IS_ERR(dev) ? PTR_ERR(dev) : 0; return IS_ERR(dev) ? PTR_ERR(dev) : 0;
} }
......
...@@ -163,8 +163,8 @@ static int __cpuinit msr_device_create(int cpu) ...@@ -163,8 +163,8 @@ static int __cpuinit msr_device_create(int cpu)
{ {
struct device *dev; struct device *dev;
dev = device_create_drvdata(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), NULL,
NULL, "msr%d", cpu); "msr%d", cpu);
return IS_ERR(dev) ? PTR_ERR(dev) : 0; return IS_ERR(dev) ? PTR_ERR(dev) : 0;
} }
......
...@@ -15,8 +15,7 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) ...@@ -15,8 +15,7 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot)
struct device *cd; struct device *cd;
static int req_count; static int req_count;
cd = device_create_drvdata(dca_class, dca->cd, cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), NULL,
MKDEV(0, slot + 1), NULL,
"requester%d", req_count++); "requester%d", req_count++);
if (IS_ERR(cd)) if (IS_ERR(cd))
return PTR_ERR(cd); return PTR_ERR(cd);
...@@ -48,8 +47,7 @@ int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev) ...@@ -48,8 +47,7 @@ int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev)
return err; return err;
} }
cd = device_create_drvdata(dca_class, dev, MKDEV(0, 0), NULL, cd = device_create(dca_class, dev, MKDEV(0, 0), NULL, "dca%d", dca->id);
"dca%d", dca->id);
if (IS_ERR(cd)) { if (IS_ERR(cd)) {
spin_lock(&dca_idr_lock); spin_lock(&dca_idr_lock);
idr_remove(&dca_idr, dca->id); idr_remove(&dca_idr, dca->id);
......
...@@ -326,9 +326,8 @@ int hidraw_connect(struct hid_device *hid) ...@@ -326,9 +326,8 @@ int hidraw_connect(struct hid_device *hid)
goto out; goto out;
} }
dev->dev = device_create_drvdata(hidraw_class, NULL, dev->dev = device_create(hidraw_class, NULL, MKDEV(hidraw_major, minor),
MKDEV(hidraw_major, minor), NULL, NULL, "%s%d", "hidraw", minor);
"%s%d", "hidraw", minor);
if (IS_ERR(dev->dev)) { if (IS_ERR(dev->dev)) {
spin_lock(&minors_lock); spin_lock(&minors_lock);
......
...@@ -55,7 +55,7 @@ struct device *hwmon_device_register(struct device *dev) ...@@ -55,7 +55,7 @@ struct device *hwmon_device_register(struct device *dev)
return ERR_PTR(err); return ERR_PTR(err);
id = id & MAX_ID_MASK; id = id & MAX_ID_MASK;
hwdev = device_create_drvdata(hwmon_class, dev, MKDEV(0, 0), NULL, hwdev = device_create(hwmon_class, dev, MKDEV(0, 0), NULL,
HWMON_ID_FORMAT, id); HWMON_ID_FORMAT, id);
if (IS_ERR(hwdev)) { if (IS_ERR(hwdev)) {
......
...@@ -521,9 +521,9 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap) ...@@ -521,9 +521,9 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap)
return PTR_ERR(i2c_dev); return PTR_ERR(i2c_dev);
/* register this i2c device with the driver core */ /* register this i2c device with the driver core */
i2c_dev->dev = device_create_drvdata(i2c_dev_class, &adap->dev, i2c_dev->dev = device_create(i2c_dev_class, &adap->dev,
MKDEV(I2C_MAJOR, adap->nr), MKDEV(I2C_MAJOR, adap->nr), NULL,
NULL, "i2c-%d", adap->nr); "i2c-%d", adap->nr);
if (IS_ERR(i2c_dev->dev)) { if (IS_ERR(i2c_dev->dev)) {
res = PTR_ERR(i2c_dev->dev); res = PTR_ERR(i2c_dev->dev);
goto error; goto error;
......
...@@ -1553,8 +1553,7 @@ static int __init capi_init(void) ...@@ -1553,8 +1553,7 @@ static int __init capi_init(void)
return PTR_ERR(capi_class); return PTR_ERR(capi_class);
} }
device_create_drvdata(capi_class, NULL, MKDEV(capi_major, 0), NULL, device_create(capi_class, NULL, MKDEV(capi_major, 0), NULL, "capi");
"capi");
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
if (capinc_tty_init() < 0) { if (capinc_tty_init() < 0) {
......
...@@ -103,7 +103,7 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) ...@@ -103,7 +103,7 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
{ {
int rc; int rc;
led_cdev->dev = device_create_drvdata(leds_class, parent, 0, led_cdev, led_cdev->dev = device_create(leds_class, parent, 0, led_cdev,
"%s", led_cdev->name); "%s", led_cdev->name);
if (IS_ERR(led_cdev->dev)) if (IS_ERR(led_cdev->dev))
return PTR_ERR(led_cdev->dev); return PTR_ERR(led_cdev->dev);
......
...@@ -862,8 +862,7 @@ adbdev_init(void) ...@@ -862,8 +862,7 @@ adbdev_init(void)
adb_dev_class = class_create(THIS_MODULE, "adb"); adb_dev_class = class_create(THIS_MODULE, "adb");
if (IS_ERR(adb_dev_class)) if (IS_ERR(adb_dev_class))
return; return;
device_create_drvdata(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, device_create(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, "adb");
"adb");
platform_device_register(&adb_pfdev); platform_device_register(&adb_pfdev);
platform_driver_probe(&adb_pfdrv, adb_dummy_probe); platform_driver_probe(&adb_pfdrv, adb_dummy_probe);
......
...@@ -233,7 +233,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, ...@@ -233,7 +233,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
mutex_unlock(&dvbdev_register_lock); 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)), MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
NULL, "dvb%d.%s%d", adap->num, dnames[type], id); NULL, "dvb%d.%s%d", adap->num, dnames[type], id);
if (IS_ERR(clsdev)) { if (IS_ERR(clsdev)) {
......
...@@ -399,9 +399,9 @@ static int __devinit phantom_probe(struct pci_dev *pdev, ...@@ -399,9 +399,9 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
goto err_irq; goto err_irq;
} }
if (IS_ERR(device_create_drvdata(phantom_class, &pdev->dev, if (IS_ERR(device_create(phantom_class, &pdev->dev,
MKDEV(phantom_major, minor), MKDEV(phantom_major, minor), NULL,
NULL, "phantom%u", minor))) "phantom%u", minor)))
dev_err(&pdev->dev, "can't create device\n"); dev_err(&pdev->dev, "can't create device\n");
pci_set_drvdata(pdev, pht); pci_set_drvdata(pdev, pht);
......
...@@ -26,12 +26,10 @@ static void mtd_notify_add(struct mtd_info* mtd) ...@@ -26,12 +26,10 @@ static void mtd_notify_add(struct mtd_info* mtd)
if (!mtd) if (!mtd)
return; return;
device_create_drvdata(mtd_class, NULL, device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
MKDEV(MTD_CHAR_MAJOR, mtd->index*2),
NULL, "mtd%d", mtd->index); NULL, "mtd%d", mtd->index);
device_create_drvdata(mtd_class, NULL, device_create(mtd_class, NULL, MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
MKDEV(MTD_CHAR_MAJOR, mtd->index*2+1),
NULL, "mtd%dro", mtd->index); NULL, "mtd%dro", mtd->index);
} }
......
...@@ -91,8 +91,8 @@ int power_supply_register(struct device *parent, struct power_supply *psy) ...@@ -91,8 +91,8 @@ int power_supply_register(struct device *parent, struct power_supply *psy)
{ {
int rc = 0; int rc = 0;
psy->dev = device_create_drvdata(power_supply_class, parent, 0, psy->dev = device_create(power_supply_class, parent, 0, psy,
psy, "%s", psy->name); "%s", psy->name);
if (IS_ERR(psy->dev)) { if (IS_ERR(psy->dev)) {
rc = PTR_ERR(psy->dev); rc = PTR_ERR(psy->dev);
goto dev_create_failed; goto dev_create_failed;
......
...@@ -583,9 +583,8 @@ static int spidev_probe(struct spi_device *spi) ...@@ -583,9 +583,8 @@ static int spidev_probe(struct spi_device *spi)
struct device *dev; struct device *dev;
spidev->devt = MKDEV(SPIDEV_MAJOR, minor); spidev->devt = MKDEV(SPIDEV_MAJOR, minor);
dev = device_create_drvdata(spidev_class, &spi->dev, dev = device_create(spidev_class, &spi->dev, spidev->devt,
spidev->devt, spidev, spidev, "spidev%d.%d",
"spidev%d.%d",
spi->master->bus_num, spi->chip_select); spi->master->bus_num, spi->chip_select);
status = IS_ERR(dev) ? PTR_ERR(dev) : 0; status = IS_ERR(dev) ? PTR_ERR(dev) : 0;
} else { } else {
......
...@@ -682,7 +682,7 @@ int __uio_register_device(struct module *owner, ...@@ -682,7 +682,7 @@ int __uio_register_device(struct module *owner,
if (ret) if (ret)
goto err_get_minor; goto err_get_minor;
idev->dev = device_create_drvdata(uio_class->class, parent, idev->dev = device_create(uio_class->class, parent,
MKDEV(uio_major, idev->minor), idev, MKDEV(uio_major, idev->minor), idev,
"uio%d", idev->minor); "uio%d", idev->minor);
if (IS_ERR(idev->dev)) { if (IS_ERR(idev->dev)) {
......
...@@ -362,9 +362,8 @@ static int init_coda_psdev(void) ...@@ -362,9 +362,8 @@ static int init_coda_psdev(void)
goto out_chrdev; goto out_chrdev;
} }
for (i = 0; i < MAX_CODADEVS; i++) for (i = 0; i < MAX_CODADEVS; i++)
device_create_drvdata(coda_psdev_class, NULL, device_create(coda_psdev_class, NULL,
MKDEV(CODA_PSDEV_MAJOR, i), MKDEV(CODA_PSDEV_MAJOR, i), NULL, "cfs%d", i);
NULL, "cfs%d", i);
coda_sysctl_init(); coda_sysctl_init();
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册