1
0
Fork 0

device create: char: 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>
hifive-unleashed-5.1
Greg Kroah-Hartman 2008-07-21 20:03:34 -07:00
parent 1ff9f542e5
commit 03457cd455
18 changed files with 43 additions and 49 deletions

View File

@ -229,8 +229,7 @@ static int bsr_create_devs(struct device_node *bn)
if (result) if (result)
goto out_err; goto out_err;
cur->bsr_device = device_create_drvdata(bsr_class, NULL, cur->bsr_device = device_create(bsr_class, NULL, cur->bsr_dev,
cur->bsr_dev,
cur, cur->bsr_name); cur, cur->bsr_name);
if (!cur->bsr_device) { if (!cur->bsr_device) {
printk(KERN_ERR "device_create failed for %s\n", printk(KERN_ERR "device_create failed for %s\n",

View File

@ -508,8 +508,8 @@ static int __init dsp56k_init_driver(void)
err = PTR_ERR(dsp56k_class); err = PTR_ERR(dsp56k_class);
goto out_chrdev; goto out_chrdev;
} }
device_create_drvdata(dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0), device_create(dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0), NULL,
NULL, "dsp56k"); "dsp56k");
printk(banner); printk(banner);
goto out; goto out;

View File

@ -745,10 +745,10 @@ static int __init ip2_loadmain(void)
pB = i2BoardPtrTable[i]; pB = i2BoardPtrTable[i];
if (pB != NULL) { if (pB != NULL) {
device_create_drvdata(ip2_class, NULL, device_create(ip2_class, NULL,
MKDEV(IP2_IPL_MAJOR, 4 * i), MKDEV(IP2_IPL_MAJOR, 4 * i),
NULL, "ipl%d", i); NULL, "ipl%d", i);
device_create_drvdata(ip2_class, NULL, device_create(ip2_class, NULL,
MKDEV(IP2_IPL_MAJOR, 4 * i + 1), MKDEV(IP2_IPL_MAJOR, 4 * i + 1),
NULL, "stat%d", i); NULL, "stat%d", i);

View File

@ -871,7 +871,7 @@ static void ipmi_new_smi(int if_num, struct device *device)
entry->dev = dev; entry->dev = dev;
mutex_lock(&reg_list_mutex); mutex_lock(&reg_list_mutex);
device_create_drvdata(ipmi_class, device, dev, NULL, "ipmi%d", if_num); device_create(ipmi_class, device, dev, NULL, "ipmi%d", if_num);
list_add(&entry->link, &reg_list); list_add(&entry->link, &reg_list);
mutex_unlock(&reg_list_mutex); mutex_unlock(&reg_list_mutex);
} }

View File

@ -4600,8 +4600,7 @@ static int __init istallion_module_init(void)
istallion_class = class_create(THIS_MODULE, "staliomem"); istallion_class = class_create(THIS_MODULE, "staliomem");
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
device_create_drvdata(istallion_class, NULL, device_create(istallion_class, NULL, MKDEV(STL_SIOMEMMAJOR, i),
MKDEV(STL_SIOMEMMAJOR, i),
NULL, "staliomem%d", i); NULL, "staliomem%d", i);
return 0; return 0;

View File

@ -813,7 +813,7 @@ static int lp_register(int nr, struct parport *port)
if (reset) if (reset)
lp_reset(nr); lp_reset(nr);
device_create_drvdata(lp_class, port->dev, MKDEV(LP_MAJOR, nr), NULL, device_create(lp_class, port->dev, MKDEV(LP_MAJOR, nr), NULL,
"lp%d", nr); "lp%d", nr);
printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name, printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name,

View File

@ -992,9 +992,9 @@ static int __init chr_dev_init(void)
mem_class = class_create(THIS_MODULE, "mem"); mem_class = class_create(THIS_MODULE, "mem");
for (i = 0; i < ARRAY_SIZE(devlist); i++) for (i = 0; i < ARRAY_SIZE(devlist); i++)
device_create_drvdata(mem_class, NULL, device_create(mem_class, NULL,
MKDEV(MEM_MAJOR, devlist[i].minor), MKDEV(MEM_MAJOR, devlist[i].minor), NULL,
NULL, devlist[i].name); devlist[i].name);
return 0; return 0;
} }

View File

@ -217,8 +217,8 @@ int misc_register(struct miscdevice * misc)
misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7); misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7);
dev = MKDEV(MISC_MAJOR, misc->minor); dev = MKDEV(MISC_MAJOR, misc->minor);
misc->this_device = device_create_drvdata(misc_class, misc->parent, misc->this_device = device_create(misc_class, misc->parent, dev, NULL,
dev, NULL, "%s", misc->name); "%s", misc->name);
if (IS_ERR(misc->this_device)) { if (IS_ERR(misc->this_device)) {
err = PTR_ERR(misc->this_device); err = PTR_ERR(misc->this_device);
goto out; goto out;

View File

@ -1871,7 +1871,7 @@ static int cm4000_probe(struct pcmcia_device *link)
return ret; return ret;
} }
device_create_drvdata(cmm_class, NULL, MKDEV(major, i), NULL, "cmm%d", i); device_create(cmm_class, NULL, MKDEV(major, i), NULL, "cmm%d", i);
return 0; return 0;
} }

View File

@ -637,8 +637,7 @@ static int reader_probe(struct pcmcia_device *link)
return ret; return ret;
} }
device_create_drvdata(cmx_class, NULL, MKDEV(major, i), NULL, device_create(cmx_class, NULL, MKDEV(major, i), NULL, "cmx%d", i);
"cmx%d", i);
return 0; return 0;
} }

View File

@ -760,8 +760,7 @@ static const struct file_operations pp_fops = {
static void pp_attach(struct parport *port) static void pp_attach(struct parport *port)
{ {
device_create_drvdata(ppdev_class, port->dev, device_create(ppdev_class, port->dev, MKDEV(PP_MAJOR, port->number),
MKDEV(PP_MAJOR, port->number),
NULL, "parport%d", port->number); NULL, "parport%d", port->number);
} }

View File

@ -131,8 +131,8 @@ raw_ioctl(struct inode *inode, struct file *filp,
static void bind_device(struct raw_config_request *rq) static void bind_device(struct raw_config_request *rq)
{ {
device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor)); device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor));
device_create_drvdata(raw_class, NULL, MKDEV(RAW_MAJOR, rq->raw_minor), device_create(raw_class, NULL, MKDEV(RAW_MAJOR, rq->raw_minor), NULL,
NULL, "raw%d", rq->raw_minor); "raw%d", rq->raw_minor);
} }
/* /*
@ -283,8 +283,7 @@ static int __init raw_init(void)
ret = PTR_ERR(raw_class); ret = PTR_ERR(raw_class);
goto error_region; goto error_region;
} }
device_create_drvdata(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL, device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL, "rawctl");
"rawctl");
return 0; return 0;

View File

@ -444,7 +444,7 @@ scdrv_init(void)
continue; continue;
} }
device_create_drvdata(snsc_class, NULL, dev, NULL, device_create(snsc_class, NULL, dev, NULL,
"%s", devname); "%s", devname);
ia64_sn_irtr_intr_enable(scd->scd_nasid, ia64_sn_irtr_intr_enable(scd->scd_nasid,

View File

@ -4743,7 +4743,7 @@ static int __init stallion_module_init(void)
if (IS_ERR(stallion_class)) if (IS_ERR(stallion_class))
printk("STALLION: failed to create class\n"); printk("STALLION: failed to create class\n");
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
device_create_drvdata(stallion_class, NULL, MKDEV(STL_SIOMEMMAJOR, i), device_create(stallion_class, NULL, MKDEV(STL_SIOMEMMAJOR, i),
NULL, "staliomem%d", i); NULL, "staliomem%d", i);
return 0; return 0;

View File

@ -2850,7 +2850,7 @@ struct device *tty_register_device(struct tty_driver *driver, unsigned index,
else else
tty_line_name(driver, index, name); tty_line_name(driver, index, name);
return device_create_drvdata(tty_class, device, dev, NULL, name); return device_create(tty_class, device, dev, NULL, name);
} }
EXPORT_SYMBOL(tty_register_device); EXPORT_SYMBOL(tty_register_device);

View File

@ -481,10 +481,10 @@ static struct class *vc_class;
void vcs_make_sysfs(struct tty_struct *tty) void vcs_make_sysfs(struct tty_struct *tty)
{ {
device_create_drvdata(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 1), device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 1), NULL,
NULL, "vcs%u", tty->index + 1); "vcs%u", tty->index + 1);
device_create_drvdata(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 129), device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 129), NULL,
NULL, "vcsa%u", tty->index + 1); "vcsa%u", tty->index + 1);
} }
void vcs_remove_sysfs(struct tty_struct *tty) void vcs_remove_sysfs(struct tty_struct *tty)
@ -499,7 +499,7 @@ int __init vcs_init(void)
panic("unable to get major %d for vcs device", VCS_MAJOR); panic("unable to get major %d for vcs device", VCS_MAJOR);
vc_class = class_create(THIS_MODULE, "vc"); vc_class = class_create(THIS_MODULE, "vc");
device_create_drvdata(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs"); device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs");
device_create_drvdata(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa"); device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa");
return 0; return 0;
} }

View File

@ -886,10 +886,10 @@ static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
state[i].cur_part = 0; state[i].cur_part = 0;
for (j = 0; j < MAX_PARTITIONS; ++j) for (j = 0; j < MAX_PARTITIONS; ++j)
state[i].part_stat_rwi[j] = VIOT_IDLE; state[i].part_stat_rwi[j] = VIOT_IDLE;
device_create_drvdata(tape_class, NULL, MKDEV(VIOTAPE_MAJOR, i), device_create(tape_class, NULL, MKDEV(VIOTAPE_MAJOR, i), NULL,
NULL, "iseries!vt%d", i); "iseries!vt%d", i);
device_create_drvdata(tape_class, NULL, MKDEV(VIOTAPE_MAJOR, i | 0x80), device_create(tape_class, NULL, MKDEV(VIOTAPE_MAJOR, i | 0x80), NULL,
NULL, "iseries!nvt%d", i); "iseries!nvt%d", i);
printk(VIOTAPE_KERN_INFO "tape iseries/vt%d is iSeries " printk(VIOTAPE_KERN_INFO "tape iseries/vt%d is iSeries "
"resource %10.10s type %4.4s, model %3.3s\n", "resource %10.10s type %4.4s, model %3.3s\n",
i, viotape_unitinfo[i].rsrcname, i, viotape_unitinfo[i].rsrcname,

View File

@ -657,8 +657,7 @@ static int __devinit hwicap_setup(struct device *dev, int id,
goto failed3; goto failed3;
} }
device_create_drvdata(icap_class, dev, devt, NULL, device_create(icap_class, dev, devt, NULL, "%s%d", DRIVER_NAME, id);
"%s%d", DRIVER_NAME, id);
return 0; /* success */ return 0; /* success */
failed3: failed3: