aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-05-21 15:52:33 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-07-22 00:54:41 -0400
commit47aa5793f78c274d51711f6a621fa6b02d4e6402 (patch)
tree88c45b3a90fc7d7b4210bf5727497294b0a951eb /drivers/char
parentf79f060561d04a38d41e773ade9baafce3c96179 (diff)
device create: char: convert device_create to device_create_drvdata
device_create() is race-prone, so use the race-free device_create_drvdata() instead as device_create() is going away. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/dsp56k.c3
-rw-r--r--drivers/char/ip2/ip2main.c12
-rw-r--r--drivers/char/ipmi/ipmi_devintf.c2
-rw-r--r--drivers/char/istallion.c5
-rw-r--r--drivers/char/lp.c3
-rw-r--r--drivers/char/mem.c6
-rw-r--r--drivers/char/misc.c4
-rw-r--r--drivers/char/pcmcia/cm4000_cs.c2
-rw-r--r--drivers/char/pcmcia/cm4040_cs.c3
-rw-r--r--drivers/char/ppdev.c5
-rw-r--r--drivers/char/raw.c7
-rw-r--r--drivers/char/snsc.c3
-rw-r--r--drivers/char/stallion.c4
-rw-r--r--drivers/char/tty_io.c12
-rw-r--r--drivers/char/vc_screen.c12
-rw-r--r--drivers/char/viotape.c8
-rw-r--r--drivers/char/vt.c14
-rw-r--r--drivers/char/xilinx_hwicap/xilinx_hwicap.c5
18 files changed, 61 insertions, 49 deletions
diff --git a/drivers/char/dsp56k.c b/drivers/char/dsp56k.c
index b9a30c30e2b8..33c466a4888f 100644
--- a/drivers/char/dsp56k.c
+++ b/drivers/char/dsp56k.c
@@ -500,7 +500,8 @@ static int __init dsp56k_init_driver(void)
500 err = PTR_ERR(dsp56k_class); 500 err = PTR_ERR(dsp56k_class);
501 goto out_chrdev; 501 goto out_chrdev;
502 } 502 }
503 device_create(dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0), "dsp56k"); 503 device_create_drvdata(dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0),
504 NULL, "dsp56k");
504 505
505 printk(banner); 506 printk(banner);
506 goto out; 507 goto out;
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c
index 5dc74404058f..9cb48fcd316c 100644
--- a/drivers/char/ip2/ip2main.c
+++ b/drivers/char/ip2/ip2main.c
@@ -718,12 +718,12 @@ ip2_loadmain(int *iop, int *irqp)
718 } 718 }
719 719
720 if ( NULL != ( pB = i2BoardPtrTable[i] ) ) { 720 if ( NULL != ( pB = i2BoardPtrTable[i] ) ) {
721 device_create(ip2_class, NULL, 721 device_create_drvdata(ip2_class, NULL,
722 MKDEV(IP2_IPL_MAJOR, 4 * i), 722 MKDEV(IP2_IPL_MAJOR, 4 * i),
723 "ipl%d", i); 723 NULL, "ipl%d", i);
724 device_create(ip2_class, NULL, 724 device_create_drvdata(ip2_class, NULL,
725 MKDEV(IP2_IPL_MAJOR, 4 * i + 1), 725 MKDEV(IP2_IPL_MAJOR, 4 * i + 1),
726 "stat%d", i); 726 NULL, "stat%d", i);
727 727
728 for ( box = 0; box < ABS_MAX_BOXES; ++box ) 728 for ( box = 0; box < ABS_MAX_BOXES; ++box )
729 { 729 {
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index c11a40483459..64e1c169e826 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -871,7 +871,7 @@ static void ipmi_new_smi(int if_num, struct device *device)
871 entry->dev = dev; 871 entry->dev = dev;
872 872
873 mutex_lock(&reg_list_mutex); 873 mutex_lock(&reg_list_mutex);
874 device_create(ipmi_class, device, dev, "ipmi%d", if_num); 874 device_create_drvdata(ipmi_class, device, dev, NULL, "ipmi%d", if_num);
875 list_add(&entry->link, &reg_list); 875 list_add(&entry->link, &reg_list);
876 mutex_unlock(&reg_list_mutex); 876 mutex_unlock(&reg_list_mutex);
877} 877}
diff --git a/drivers/char/istallion.c b/drivers/char/istallion.c
index 7930fba4bafc..24637bbf02f7 100644
--- a/drivers/char/istallion.c
+++ b/drivers/char/istallion.c
@@ -4599,8 +4599,9 @@ static int __init istallion_module_init(void)
4599 4599
4600 istallion_class = class_create(THIS_MODULE, "staliomem"); 4600 istallion_class = class_create(THIS_MODULE, "staliomem");
4601 for (i = 0; i < 4; i++) 4601 for (i = 0; i < 4; i++)
4602 device_create(istallion_class, NULL, MKDEV(STL_SIOMEMMAJOR, i), 4602 device_create_drvdata(istallion_class, NULL,
4603 "staliomem%d", i); 4603 MKDEV(STL_SIOMEMMAJOR, i),
4604 NULL, "staliomem%d", i);
4604 4605
4605 return 0; 4606 return 0;
4606err_deinit: 4607err_deinit:
diff --git a/drivers/char/lp.c b/drivers/char/lp.c
index 71abb4c33aa2..3f2719b9f77b 100644
--- a/drivers/char/lp.c
+++ b/drivers/char/lp.c
@@ -813,7 +813,8 @@ static int lp_register(int nr, struct parport *port)
813 if (reset) 813 if (reset)
814 lp_reset(nr); 814 lp_reset(nr);
815 815
816 device_create(lp_class, port->dev, MKDEV(LP_MAJOR, nr), "lp%d", nr); 816 device_create_drvdata(lp_class, port->dev, MKDEV(LP_MAJOR, nr), NULL,
817 "lp%d", nr);
817 818
818 printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name, 819 printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name,
819 (port->irq == PARPORT_IRQ_NONE)?"polling":"interrupt-driven"); 820 (port->irq == PARPORT_IRQ_NONE)?"polling":"interrupt-driven");
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index b6772d657547..c2dba82eb5f7 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -989,9 +989,9 @@ static int __init chr_dev_init(void)
989 989
990 mem_class = class_create(THIS_MODULE, "mem"); 990 mem_class = class_create(THIS_MODULE, "mem");
991 for (i = 0; i < ARRAY_SIZE(devlist); i++) 991 for (i = 0; i < ARRAY_SIZE(devlist); i++)
992 device_create(mem_class, NULL, 992 device_create_drvdata(mem_class, NULL,
993 MKDEV(MEM_MAJOR, devlist[i].minor), 993 MKDEV(MEM_MAJOR, devlist[i].minor),
994 devlist[i].name); 994 NULL, devlist[i].name);
995 995
996 return 0; 996 return 0;
997} 997}
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 6e1563c3d30a..999aa779c08a 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -217,8 +217,8 @@ int misc_register(struct miscdevice * misc)
217 misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7); 217 misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7);
218 dev = MKDEV(MISC_MAJOR, misc->minor); 218 dev = MKDEV(MISC_MAJOR, misc->minor);
219 219
220 misc->this_device = device_create(misc_class, misc->parent, dev, 220 misc->this_device = device_create_drvdata(misc_class, misc->parent,
221 "%s", misc->name); 221 dev, NULL, "%s", misc->name);
222 if (IS_ERR(misc->this_device)) { 222 if (IS_ERR(misc->this_device)) {
223 err = PTR_ERR(misc->this_device); 223 err = PTR_ERR(misc->this_device);
224 goto out; 224 goto out;
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c
index e4a4fbd37d7a..f070ae7bd91a 100644
--- a/drivers/char/pcmcia/cm4000_cs.c
+++ b/drivers/char/pcmcia/cm4000_cs.c
@@ -1896,7 +1896,7 @@ static int cm4000_probe(struct pcmcia_device *link)
1896 return ret; 1896 return ret;
1897 } 1897 }
1898 1898
1899 device_create(cmm_class, NULL, MKDEV(major, i), "cmm%d", i); 1899 device_create_drvdata(cmm_class, NULL, MKDEV(major, i), NULL, "cmm%d", i);
1900 1900
1901 return 0; 1901 return 0;
1902} 1902}
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c
index 6181f8a9b0bd..0b5934bef7a4 100644
--- a/drivers/char/pcmcia/cm4040_cs.c
+++ b/drivers/char/pcmcia/cm4040_cs.c
@@ -653,7 +653,8 @@ static int reader_probe(struct pcmcia_device *link)
653 return ret; 653 return ret;
654 } 654 }
655 655
656 device_create(cmx_class, NULL, MKDEV(major, i), "cmx%d", i); 656 device_create_drvdata(cmx_class, NULL, MKDEV(major, i), NULL,
657 "cmx%d", i);
657 658
658 return 0; 659 return 0;
659} 660}
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c
index f6e6acadd9a0..7af7a7e6b9c2 100644
--- a/drivers/char/ppdev.c
+++ b/drivers/char/ppdev.c
@@ -752,8 +752,9 @@ static const struct file_operations pp_fops = {
752 752
753static void pp_attach(struct parport *port) 753static void pp_attach(struct parport *port)
754{ 754{
755 device_create(ppdev_class, port->dev, MKDEV(PP_MAJOR, port->number), 755 device_create_drvdata(ppdev_class, port->dev,
756 "parport%d", port->number); 756 MKDEV(PP_MAJOR, port->number),
757 NULL, "parport%d", port->number);
757} 758}
758 759
759static void pp_detach(struct parport *port) 760static void pp_detach(struct parport *port)
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index 505fcbe884a4..47b8cf281d4a 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -131,8 +131,8 @@ raw_ioctl(struct inode *inode, struct file *filp,
131static void bind_device(struct raw_config_request *rq) 131static void bind_device(struct raw_config_request *rq)
132{ 132{
133 device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor)); 133 device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor));
134 device_create(raw_class, NULL, MKDEV(RAW_MAJOR, rq->raw_minor), 134 device_create_drvdata(raw_class, NULL, MKDEV(RAW_MAJOR, rq->raw_minor),
135 "raw%d", rq->raw_minor); 135 NULL, "raw%d", rq->raw_minor);
136} 136}
137 137
138/* 138/*
@@ -283,7 +283,8 @@ static int __init raw_init(void)
283 ret = PTR_ERR(raw_class); 283 ret = PTR_ERR(raw_class);
284 goto error_region; 284 goto error_region;
285 } 285 }
286 device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), "rawctl"); 286 device_create_drvdata(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL,
287 "rawctl");
287 288
288 return 0; 289 return 0;
289 290
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index 0b799ac1b049..3ce60df14c0a 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -444,7 +444,8 @@ scdrv_init(void)
444 continue; 444 continue;
445 } 445 }
446 446
447 device_create(snsc_class, NULL, dev, "%s", devname); 447 device_create_drvdata(snsc_class, NULL, dev, NULL,
448 "%s", devname);
448 449
449 ia64_sn_irtr_intr_enable(scd->scd_nasid, 450 ia64_sn_irtr_intr_enable(scd->scd_nasid,
450 0 /*ignored */ , 451 0 /*ignored */ ,
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index 0243efb0be95..45aeeeab9f4a 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -4753,8 +4753,8 @@ static int __init stallion_module_init(void)
4753 if (IS_ERR(stallion_class)) 4753 if (IS_ERR(stallion_class))
4754 printk("STALLION: failed to create class\n"); 4754 printk("STALLION: failed to create class\n");
4755 for (i = 0; i < 4; i++) 4755 for (i = 0; i < 4; i++)
4756 device_create(stallion_class, NULL, MKDEV(STL_SIOMEMMAJOR, i), 4756 device_create_drvdata(stallion_class, NULL, MKDEV(STL_SIOMEMMAJOR, i),
4757 "staliomem%d", i); 4757 NULL, "staliomem%d", i);
4758 4758
4759 return 0; 4759 return 0;
4760err_unrtty: 4760err_unrtty:
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 82f6a8c86332..dc9202d2dd63 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -4045,7 +4045,7 @@ struct device *tty_register_device(struct tty_driver *driver, unsigned index,
4045 else 4045 else
4046 tty_line_name(driver, index, name); 4046 tty_line_name(driver, index, name);
4047 4047
4048 return device_create(tty_class, device, dev, name); 4048 return device_create_drvdata(tty_class, device, dev, NULL, name);
4049} 4049}
4050 4050
4051/** 4051/**
@@ -4323,20 +4323,22 @@ static int __init tty_init(void)
4323 if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) || 4323 if (cdev_add(&tty_cdev, MKDEV(TTYAUX_MAJOR, 0), 1) ||
4324 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0) 4324 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 0), 1, "/dev/tty") < 0)
4325 panic("Couldn't register /dev/tty driver\n"); 4325 panic("Couldn't register /dev/tty driver\n");
4326 device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), "tty"); 4326 device_create_drvdata(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 0), NULL,
4327 "tty");
4327 4328
4328 cdev_init(&console_cdev, &console_fops); 4329 cdev_init(&console_cdev, &console_fops);
4329 if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) || 4330 if (cdev_add(&console_cdev, MKDEV(TTYAUX_MAJOR, 1), 1) ||
4330 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0) 4331 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 1), 1, "/dev/console") < 0)
4331 panic("Couldn't register /dev/console driver\n"); 4332 panic("Couldn't register /dev/console driver\n");
4332 device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), "console"); 4333 device_create_drvdata(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 1), NULL,
4334 "console");
4333 4335
4334#ifdef CONFIG_UNIX98_PTYS 4336#ifdef CONFIG_UNIX98_PTYS
4335 cdev_init(&ptmx_cdev, &ptmx_fops); 4337 cdev_init(&ptmx_cdev, &ptmx_fops);
4336 if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) || 4338 if (cdev_add(&ptmx_cdev, MKDEV(TTYAUX_MAJOR, 2), 1) ||
4337 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0) 4339 register_chrdev_region(MKDEV(TTYAUX_MAJOR, 2), 1, "/dev/ptmx") < 0)
4338 panic("Couldn't register /dev/ptmx driver\n"); 4340 panic("Couldn't register /dev/ptmx driver\n");
4339 device_create(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), "ptmx"); 4341 device_create_drvdata(tty_class, NULL, MKDEV(TTYAUX_MAJOR, 2), NULL, "ptmx");
4340#endif 4342#endif
4341 4343
4342#ifdef CONFIG_VT 4344#ifdef CONFIG_VT
@@ -4344,7 +4346,7 @@ static int __init tty_init(void)
4344 if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) || 4346 if (cdev_add(&vc0_cdev, MKDEV(TTY_MAJOR, 0), 1) ||
4345 register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0) 4347 register_chrdev_region(MKDEV(TTY_MAJOR, 0), 1, "/dev/vc/0") < 0)
4346 panic("Couldn't register /dev/tty0 driver\n"); 4348 panic("Couldn't register /dev/tty0 driver\n");
4347 device_create(tty_class, NULL, MKDEV(TTY_MAJOR, 0), "tty0"); 4349 device_create_drvdata(tty_class, NULL, MKDEV(TTY_MAJOR, 0), NULL, "tty0");
4348 4350
4349 vty_init(); 4351 vty_init();
4350#endif 4352#endif
diff --git a/drivers/char/vc_screen.c b/drivers/char/vc_screen.c
index eebfad2777d2..c2ae52dd53d1 100644
--- a/drivers/char/vc_screen.c
+++ b/drivers/char/vc_screen.c
@@ -481,10 +481,10 @@ static struct class *vc_class;
481 481
482void vcs_make_sysfs(struct tty_struct *tty) 482void vcs_make_sysfs(struct tty_struct *tty)
483{ 483{
484 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 1), 484 device_create_drvdata(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 1),
485 "vcs%u", tty->index + 1); 485 NULL, "vcs%u", tty->index + 1);
486 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 129), 486 device_create_drvdata(vc_class, NULL, MKDEV(VCS_MAJOR, tty->index + 129),
487 "vcsa%u", tty->index + 1); 487 NULL, "vcsa%u", tty->index + 1);
488} 488}
489 489
490void vcs_remove_sysfs(struct tty_struct *tty) 490void vcs_remove_sysfs(struct tty_struct *tty)
@@ -499,7 +499,7 @@ int __init vcs_init(void)
499 panic("unable to get major %d for vcs device", VCS_MAJOR); 499 panic("unable to get major %d for vcs device", VCS_MAJOR);
500 vc_class = class_create(THIS_MODULE, "vc"); 500 vc_class = class_create(THIS_MODULE, "vc");
501 501
502 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 0), "vcs"); 502 device_create_drvdata(vc_class, NULL, MKDEV(VCS_MAJOR, 0), NULL, "vcs");
503 device_create(vc_class, NULL, MKDEV(VCS_MAJOR, 128), "vcsa"); 503 device_create_drvdata(vc_class, NULL, MKDEV(VCS_MAJOR, 128), NULL, "vcsa");
504 return 0; 504 return 0;
505} 505}
diff --git a/drivers/char/viotape.c b/drivers/char/viotape.c
index e5da98d8f9cd..7a70a40ad639 100644
--- a/drivers/char/viotape.c
+++ b/drivers/char/viotape.c
@@ -886,10 +886,10 @@ static int viotape_probe(struct vio_dev *vdev, const struct vio_device_id *id)
886 state[i].cur_part = 0; 886 state[i].cur_part = 0;
887 for (j = 0; j < MAX_PARTITIONS; ++j) 887 for (j = 0; j < MAX_PARTITIONS; ++j)
888 state[i].part_stat_rwi[j] = VIOT_IDLE; 888 state[i].part_stat_rwi[j] = VIOT_IDLE;
889 device_create(tape_class, NULL, MKDEV(VIOTAPE_MAJOR, i), 889 device_create_drvdata(tape_class, NULL, MKDEV(VIOTAPE_MAJOR, i),
890 "iseries!vt%d", i); 890 NULL, "iseries!vt%d", i);
891 device_create(tape_class, NULL, MKDEV(VIOTAPE_MAJOR, i | 0x80), 891 device_create_drvdata(tape_class, NULL, MKDEV(VIOTAPE_MAJOR, i | 0x80),
892 "iseries!nvt%d", i); 892 NULL, "iseries!nvt%d", i);
893 printk(VIOTAPE_KERN_INFO "tape iseries/vt%d is iSeries " 893 printk(VIOTAPE_KERN_INFO "tape iseries/vt%d is iSeries "
894 "resource %10.10s type %4.4s, model %3.3s\n", 894 "resource %10.10s type %4.4s, model %3.3s\n",
895 i, viotape_unitinfo[i].rsrcname, 895 i, viotape_unitinfo[i].rsrcname,
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 935f1c207a1f..e32a076d5f1f 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -3425,9 +3425,10 @@ int register_con_driver(const struct consw *csw, int first, int last)
3425 if (retval) 3425 if (retval)
3426 goto err; 3426 goto err;
3427 3427
3428 con_driver->dev = device_create(vtconsole_class, NULL, 3428 con_driver->dev = device_create_drvdata(vtconsole_class, NULL,
3429 MKDEV(0, con_driver->node), 3429 MKDEV(0, con_driver->node),
3430 "vtcon%i", con_driver->node); 3430 NULL, "vtcon%i",
3431 con_driver->node);
3431 3432
3432 if (IS_ERR(con_driver->dev)) { 3433 if (IS_ERR(con_driver->dev)) {
3433 printk(KERN_WARNING "Unable to create device for %s; " 3434 printk(KERN_WARNING "Unable to create device for %s; "
@@ -3535,9 +3536,10 @@ static int __init vtconsole_class_init(void)
3535 struct con_driver *con = &registered_con_driver[i]; 3536 struct con_driver *con = &registered_con_driver[i];
3536 3537
3537 if (con->con && !con->dev) { 3538 if (con->con && !con->dev) {
3538 con->dev = device_create(vtconsole_class, NULL, 3539 con->dev = device_create_drvdata(vtconsole_class, NULL,
3539 MKDEV(0, con->node), 3540 MKDEV(0, con->node),
3540 "vtcon%i", con->node); 3541 NULL, "vtcon%i",
3542 con->node);
3541 3543
3542 if (IS_ERR(con->dev)) { 3544 if (IS_ERR(con->dev)) {
3543 printk(KERN_WARNING "Unable to create " 3545 printk(KERN_WARNING "Unable to create "
diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
index 1e1b81e57cdc..51966ccf4ea3 100644
--- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
+++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
@@ -658,8 +658,9 @@ static int __devinit hwicap_setup(struct device *dev, int id,
658 dev_err(dev, "cdev_add() failed\n"); 658 dev_err(dev, "cdev_add() failed\n");
659 goto failed3; 659 goto failed3;
660 } 660 }
661 /* devfs_mk_cdev(devt, S_IFCHR|S_IRUGO|S_IWUGO, DRIVER_NAME); */ 661
662 device_create(icap_class, dev, devt, "%s%d", DRIVER_NAME, id); 662 device_create_drvdata(icap_class, dev, devt, NULL,
663 "%s%d", DRIVER_NAME, id);
663 return 0; /* success */ 664 return 0; /* success */
664 665
665 failed3: 666 failed3: