提交 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)
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;
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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 @@ int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev)
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);
......
......@@ -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);
......
......@@ -55,8 +55,8 @@ struct device *hwmon_device_register(struct device *dev)
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);
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)) {
......
......@@ -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);
......
......@@ -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)
......
......@@ -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;
......
......@@ -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");
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册