Skip to content

Commit 07c015e

Browse files
tonyj-susegregkh
authored andcommitted
Convert from class_device to device in drivers/char
Convert from class_device to device in drivers/char. Signed-off-by: Tony Jones <tonyj@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent 6004342 commit 07c015e

11 files changed

Lines changed: 32 additions & 39 deletions

File tree

‎drivers/char/dsp56k.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ static int __init dsp56k_init_driver(void)
513513
err = PTR_ERR(dsp56k_class);
514514
goto out_chrdev;
515515
}
516-
class_device_create(dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0), NULL, "dsp56k");
516+
device_create(dsp56k_class, NULL, MKDEV(DSP56K_MAJOR, 0), "dsp56k");
517517

518518
printk(banner);
519519
goto out;
@@ -527,7 +527,7 @@ module_init(dsp56k_init_driver);
527527

528528
static void __exit dsp56k_cleanup_driver(void)
529529
{
530-
class_device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
530+
device_destroy(dsp56k_class, MKDEV(DSP56K_MAJOR, 0));
531531
class_destroy(dsp56k_class);
532532
unregister_chrdev(DSP56K_MAJOR, "dsp56k");
533533
}

‎drivers/char/ip2/ip2main.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ cleanup_module(void)
411411
iiResetDelay( i2BoardPtrTable[i] );
412412
/* free io addresses and Tibet */
413413
release_region( ip2config.addr[i], 8 );
414-
class_device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i));
415-
class_device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i + 1));
414+
device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i));
415+
device_destroy(ip2_class, MKDEV(IP2_IPL_MAJOR, 4 * i + 1));
416416
}
417417
/* Disable and remove interrupt handler. */
418418
if ( (ip2config.irq[i] > 0) && have_requested_irq(ip2config.irq[i]) ) {
@@ -718,12 +718,12 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
718718
}
719719

720720
if ( NULL != ( pB = i2BoardPtrTable[i] ) ) {
721-
class_device_create(ip2_class, NULL,
721+
device_create(ip2_class, NULL,
722722
MKDEV(IP2_IPL_MAJOR, 4 * i),
723-
NULL, "ipl%d", i);
724-
class_device_create(ip2_class, NULL,
723+
"ipl%d", i);
724+
device_create(ip2_class, NULL,
725725
MKDEV(IP2_IPL_MAJOR, 4 * i + 1),
726-
NULL, "stat%d", i);
726+
"stat%d", i);
727727

728728
for ( box = 0; box < ABS_MAX_BOXES; ++box )
729729
{

‎drivers/char/ipmi/ipmi_devintf.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ static void ipmi_new_smi(int if_num, struct device *device)
865865
entry->dev = dev;
866866

867867
mutex_lock(&reg_list_mutex);
868-
class_device_create(ipmi_class, NULL, dev, device, "ipmi%d", if_num);
868+
device_create(ipmi_class, device, dev, "ipmi%d", if_num);
869869
list_add(&entry->link, &reg_list);
870870
mutex_unlock(&reg_list_mutex);
871871
}
@@ -883,7 +883,7 @@ static void ipmi_smi_gone(int if_num)
883883
break;
884884
}
885885
}
886-
class_device_destroy(ipmi_class, dev);
886+
device_destroy(ipmi_class, dev);
887887
mutex_unlock(&reg_list_mutex);
888888
}
889889

@@ -938,7 +938,7 @@ static __exit void cleanup_ipmi(void)
938938
mutex_lock(&reg_list_mutex);
939939
list_for_each_entry_safe(entry, entry2, &reg_list, link) {
940940
list_del(&entry->link);
941-
class_device_destroy(ipmi_class, entry->dev);
941+
device_destroy(ipmi_class, entry->dev);
942942
kfree(entry);
943943
}
944944
mutex_unlock(&reg_list_mutex);

‎drivers/char/istallion.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4624,9 +4624,8 @@ static int __init istallion_module_init(void)
46244624

46254625
istallion_class = class_create(THIS_MODULE, "staliomem");
46264626
for (i = 0; i < 4; i++)
4627-
class_device_create(istallion_class, NULL,
4628-
MKDEV(STL_SIOMEMMAJOR, i),
4629-
NULL, "staliomem%d", i);
4627+
device_create(istallion_class, NULL, MKDEV(STL_SIOMEMMAJOR, i),
4628+
"staliomem%d", i);
46304629

46314630
return 0;
46324631
err_deinit:
@@ -4659,8 +4658,7 @@ static void __exit istallion_module_exit(void)
46594658
unregister_chrdev(STL_SIOMEMMAJOR, "staliomem");
46604659

46614660
for (j = 0; j < 4; j++)
4662-
class_device_destroy(istallion_class, MKDEV(STL_SIOMEMMAJOR,
4663-
j));
4661+
device_destroy(istallion_class, MKDEV(STL_SIOMEMMAJOR, j));
46644662
class_destroy(istallion_class);
46654663

46664664
pci_unregister_driver(&stli_pcidriver);

‎drivers/char/lp.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,7 @@ static int lp_register(int nr, struct parport *port)
799799
if (reset)
800800
lp_reset(nr);
801801

802-
class_device_create(lp_class, NULL, MKDEV(LP_MAJOR, nr), port->dev,
803-
"lp%d", nr);
802+
device_create(lp_class, port->dev, MKDEV(LP_MAJOR, nr), "lp%d", nr);
804803

805804
printk(KERN_INFO "lp%d: using %s (%s).\n", nr, port->name,
806805
(port->irq == PARPORT_IRQ_NONE)?"polling":"interrupt-driven");
@@ -971,7 +970,7 @@ static void lp_cleanup_module (void)
971970
if (lp_table[offset].dev == NULL)
972971
continue;
973972
parport_unregister_device(lp_table[offset].dev);
974-
class_device_destroy(lp_class, MKDEV(LP_MAJOR, offset));
973+
device_destroy(lp_class, MKDEV(LP_MAJOR, offset));
975974
}
976975
class_destroy(lp_class);
977976
}

‎drivers/char/pcmcia/cm4000_cs.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,8 +1863,7 @@ static int cm4000_probe(struct pcmcia_device *link)
18631863
return ret;
18641864
}
18651865

1866-
class_device_create(cmm_class, NULL, MKDEV(major, i), NULL,
1867-
"cmm%d", i);
1866+
device_create(cmm_class, NULL, MKDEV(major, i), "cmm%d", i);
18681867

18691868
return 0;
18701869
}
@@ -1888,7 +1887,7 @@ static void cm4000_detach(struct pcmcia_device *link)
18881887
dev_table[devno] = NULL;
18891888
kfree(dev);
18901889

1891-
class_device_destroy(cmm_class, MKDEV(major, devno));
1890+
device_destroy(cmm_class, MKDEV(major, devno));
18921891

18931892
return;
18941893
}

‎drivers/char/pcmcia/cm4040_cs.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,7 @@ static int reader_probe(struct pcmcia_device *link)
642642
return ret;
643643
}
644644

645-
class_device_create(cmx_class, NULL, MKDEV(major, i), NULL,
646-
"cmx%d", i);
645+
device_create(cmx_class, NULL, MKDEV(major, i), "cmx%d", i);
647646

648647
return 0;
649648
}
@@ -666,7 +665,7 @@ static void reader_detach(struct pcmcia_device *link)
666665
dev_table[devno] = NULL;
667666
kfree(dev);
668667

669-
class_device_destroy(cmx_class, MKDEV(major, devno));
668+
device_destroy(cmx_class, MKDEV(major, devno));
670669

671670
return;
672671
}

‎drivers/char/snsc.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,7 @@ scdrv_init(void)
441441
continue;
442442
}
443443

444-
class_device_create(snsc_class, NULL, dev, NULL,
445-
"%s", devname);
444+
device_create(snsc_class, NULL, dev, "%s", devname);
446445

447446
ia64_sn_irtr_intr_enable(scd->scd_nasid,
448447
0 /*ignored */ ,

‎drivers/char/stallion.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4778,9 +4778,8 @@ static int __init stallion_module_init(void)
47784778
if (IS_ERR(stallion_class))
47794779
printk("STALLION: failed to create class\n");
47804780
for (i = 0; i < 4; i++)
4781-
class_device_create(stallion_class, NULL,
4782-
MKDEV(STL_SIOMEMMAJOR, i), NULL,
4783-
"staliomem%d", i);
4781+
device_create(stallion_class, NULL, MKDEV(STL_SIOMEMMAJOR, i),
4782+
"staliomem%d", i);
47844783

47854784
return 0;
47864785
err_unrtty:
@@ -4816,7 +4815,7 @@ static void __exit stallion_module_exit(void)
48164815
}
48174816

48184817
for (i = 0; i < 4; i++)
4819-
class_device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
4818+
device_destroy(stallion_class, MKDEV(STL_SIOMEMMAJOR, i));
48204819
unregister_chrdev(STL_SIOMEMMAJOR, "staliomem");
48214820
class_destroy(stallion_class);
48224821

‎drivers/char/tipar.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,8 @@ tipar_register(int nr, struct parport *port)
441441
goto out;
442442
}
443443

444-
class_device_create(tipar_class, NULL, MKDEV(TIPAR_MAJOR,
445-
TIPAR_MINOR + nr), port->dev, "par%d", nr);
444+
device_create(tipar_class, port->dev, MKDEV(TIPAR_MAJOR,
445+
TIPAR_MINOR + nr), "par%d", nr);
446446

447447
/* Display informations */
448448
pr_info("tipar%d: using %s (%s)\n", nr, port->name, (port->irq ==
@@ -534,7 +534,7 @@ tipar_cleanup_module(void)
534534
if (table[i].dev == NULL)
535535
continue;
536536
parport_unregister_device(table[i].dev);
537-
class_device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, i));
537+
device_destroy(tipar_class, MKDEV(TIPAR_MAJOR, i));
538538
}
539539
class_destroy(tipar_class);
540540

0 commit comments

Comments
 (0)