Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47aa5793 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f79f0605
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -500,7 +500,8 @@ static int __init dsp56k_init_driver(void)
		err = PTR_ERR(dsp56k_class);
		goto out_chrdev;
	}
	device_create(dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0), "dsp56k");
	device_create_drvdata(dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0),
			      NULL, "dsp56k");

	printk(banner);
	goto out;
+6 −6
Original line number Diff line number Diff line
@@ -718,12 +718,12 @@ ip2_loadmain(int *iop, int *irqp)
			}

			if ( NULL != ( pB = i2BoardPtrTable[i] ) ) {
				device_create(ip2_class, NULL,
				device_create_drvdata(ip2_class, NULL,
						      MKDEV(IP2_IPL_MAJOR, 4 * i),
						"ipl%d", i);
				device_create(ip2_class, NULL,
						      NULL, "ipl%d", i);
				device_create_drvdata(ip2_class, NULL,
						      MKDEV(IP2_IPL_MAJOR, 4 * i + 1),
						"stat%d", i);
						      NULL, "stat%d", i);

			    for ( box = 0; box < ABS_MAX_BOXES; ++box )
			    {
+1 −1
Original line number Diff line number Diff line
@@ -871,7 +871,7 @@ static void ipmi_new_smi(int if_num, struct device *device)
	entry->dev = dev;

	mutex_lock(&reg_list_mutex);
	device_create(ipmi_class, device, dev, "ipmi%d", if_num);
	device_create_drvdata(ipmi_class, device, dev, NULL, "ipmi%d", if_num);
	list_add(&entry->link, &reg_list);
	mutex_unlock(&reg_list_mutex);
}
+3 −2
Original line number Diff line number Diff line
@@ -4599,8 +4599,9 @@ static int __init istallion_module_init(void)

	istallion_class = class_create(THIS_MODULE, "staliomem");
	for (i = 0; i < 4; i++)
		device_create(istallion_class, NULL, MKDEV(STL_SIOMEMMAJOR, i),
			      "staliomem%d", i);
		device_create_drvdata(istallion_class, NULL,
				      MKDEV(STL_SIOMEMMAJOR, i),
				      NULL, "staliomem%d", i);

	return 0;
err_deinit:
+2 −1
Original line number Diff line number Diff line
@@ -813,7 +813,8 @@ static int lp_register(int nr, struct parport *port)
	if (reset)
		lp_reset(nr);

	device_create(lp_class, port->dev, MKDEV(LP_MAJOR, nr), "lp%d", nr);
	device_create_drvdata(lp_class, port->dev, MKDEV(LP_MAJOR, nr), NULL,
			      "lp%d", nr);

	printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name, 
	       (port->irq == PARPORT_IRQ_NONE)?"polling":"interrupt-driven");
Loading