Commit 56b22935 authored by gregkh@suse.de's avatar gregkh@suse.de Committed by Greg Kroah-Hartman

[PATCH] class: convert drivers/* to use the new class api instead of class_simple

Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8874b414
...@@ -58,7 +58,7 @@ MODULE_LICENSE("GPL"); ...@@ -58,7 +58,7 @@ MODULE_LICENSE("GPL");
/* -------- driver information -------------------------------------- */ /* -------- driver information -------------------------------------- */
static struct class_simple *capi_class; static struct class *capi_class;
static int capi_major = 68; /* allocated */ static int capi_major = 68; /* allocated */
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
...@@ -1499,20 +1499,20 @@ static int __init capi_init(void) ...@@ -1499,20 +1499,20 @@ static int __init capi_init(void)
return -EIO; return -EIO;
} }
capi_class = class_simple_create(THIS_MODULE, "capi"); capi_class = class_create(THIS_MODULE, "capi");
if (IS_ERR(capi_class)) { if (IS_ERR(capi_class)) {
unregister_chrdev(capi_major, "capi20"); unregister_chrdev(capi_major, "capi20");
return PTR_ERR(capi_class); return PTR_ERR(capi_class);
} }
class_simple_device_add(capi_class, MKDEV(capi_major, 0), NULL, "capi"); class_device_create(capi_class, MKDEV(capi_major, 0), NULL, "capi");
devfs_mk_cdev(MKDEV(capi_major, 0), S_IFCHR | S_IRUSR | S_IWUSR, devfs_mk_cdev(MKDEV(capi_major, 0), S_IFCHR | S_IRUSR | S_IWUSR,
"isdn/capi20"); "isdn/capi20");
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
if (capinc_tty_init() < 0) { if (capinc_tty_init() < 0) {
class_simple_device_remove(MKDEV(capi_major, 0)); class_device_destroy(capi_class, MKDEV(capi_major, 0));
class_simple_destroy(capi_class); class_destroy(capi_class);
unregister_chrdev(capi_major, "capi20"); unregister_chrdev(capi_major, "capi20");
return -ENOMEM; return -ENOMEM;
} }
...@@ -1539,8 +1539,8 @@ static void __exit capi_exit(void) ...@@ -1539,8 +1539,8 @@ static void __exit capi_exit(void)
{ {
proc_exit(); proc_exit();
class_simple_device_remove(MKDEV(capi_major, 0)); class_device_destroy(capi_class, MKDEV(capi_major, 0));
class_simple_destroy(capi_class); class_destroy(capi_class);
unregister_chrdev(capi_major, "capi20"); unregister_chrdev(capi_major, "capi20");
devfs_remove("isdn/capi20"); devfs_remove("isdn/capi20");
......
...@@ -77,7 +77,7 @@ static struct adb_driver *adb_driver_list[] = { ...@@ -77,7 +77,7 @@ static struct adb_driver *adb_driver_list[] = {
NULL NULL
}; };
static struct class_simple *adb_dev_class; static struct class *adb_dev_class;
struct adb_driver *adb_controller; struct adb_driver *adb_controller;
struct notifier_block *adb_client_list = NULL; struct notifier_block *adb_client_list = NULL;
...@@ -902,9 +902,8 @@ adbdev_init(void) ...@@ -902,9 +902,8 @@ adbdev_init(void)
devfs_mk_cdev(MKDEV(ADB_MAJOR, 0), S_IFCHR | S_IRUSR | S_IWUSR, "adb"); devfs_mk_cdev(MKDEV(ADB_MAJOR, 0), S_IFCHR | S_IRUSR | S_IWUSR, "adb");
adb_dev_class = class_simple_create(THIS_MODULE, "adb"); adb_dev_class = class_create(THIS_MODULE, "adb");
if (IS_ERR(adb_dev_class)) { if (IS_ERR(adb_dev_class))
return; return;
} class_device_create(adb_dev_class, MKDEV(ADB_MAJOR, 0), NULL, "adb");
class_simple_device_add(adb_dev_class, MKDEV(ADB_MAJOR, 0), NULL, "adb");
} }
...@@ -56,8 +56,7 @@ static const char * const dnames[] = { ...@@ -56,8 +56,7 @@ static const char * const dnames[] = {
#define nums2minor(num,type,id) ((num << 6) | (id << 4) | type) #define nums2minor(num,type,id) ((num << 6) | (id << 4) | type)
#define MAX_DVB_MINORS (DVB_MAX_ADAPTERS*64) #define MAX_DVB_MINORS (DVB_MAX_ADAPTERS*64)
struct class_simple *dvb_class; static struct class *dvb_class;
EXPORT_SYMBOL(dvb_class);
static struct dvb_device* dvbdev_find_device (int minor) static struct dvb_device* dvbdev_find_device (int minor)
{ {
...@@ -236,8 +235,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, ...@@ -236,8 +235,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
S_IFCHR | S_IRUSR | S_IWUSR, S_IFCHR | S_IRUSR | S_IWUSR,
"dvb/adapter%d/%s%d", adap->num, dnames[type], id); "dvb/adapter%d/%s%d", adap->num, dnames[type], id);
class_simple_device_add(dvb_class, MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), class_device_create(dvb_class, MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
NULL, "dvb%d.%s%d", adap->num, dnames[type], id); NULL, "dvb%d.%s%d", adap->num, dnames[type], id);
dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n", dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n",
adap->num, dnames[type], id, nums2minor(adap->num, type, id), adap->num, dnames[type], id, nums2minor(adap->num, type, id),
...@@ -256,7 +255,7 @@ void dvb_unregister_device(struct dvb_device *dvbdev) ...@@ -256,7 +255,7 @@ void dvb_unregister_device(struct dvb_device *dvbdev)
devfs_remove("dvb/adapter%d/%s%d", dvbdev->adapter->num, devfs_remove("dvb/adapter%d/%s%d", dvbdev->adapter->num,
dnames[dvbdev->type], dvbdev->id); dnames[dvbdev->type], dvbdev->id);
class_simple_device_remove(MKDEV(DVB_MAJOR, nums2minor(dvbdev->adapter->num, class_device_destroy(dvb_class, MKDEV(DVB_MAJOR, nums2minor(dvbdev->adapter->num,
dvbdev->type, dvbdev->id))); dvbdev->type, dvbdev->id)));
list_del (&dvbdev->list_head); list_del (&dvbdev->list_head);
...@@ -412,7 +411,7 @@ static int __init init_dvbdev(void) ...@@ -412,7 +411,7 @@ static int __init init_dvbdev(void)
devfs_mk_dir("dvb"); devfs_mk_dir("dvb");
dvb_class = class_simple_create(THIS_MODULE, "dvb"); dvb_class = class_create(THIS_MODULE, "dvb");
if (IS_ERR(dvb_class)) { if (IS_ERR(dvb_class)) {
retval = PTR_ERR(dvb_class); retval = PTR_ERR(dvb_class);
goto error; goto error;
...@@ -429,7 +428,7 @@ static int __init init_dvbdev(void) ...@@ -429,7 +428,7 @@ static int __init init_dvbdev(void)
static void __exit exit_dvbdev(void) static void __exit exit_dvbdev(void)
{ {
devfs_remove("dvb"); devfs_remove("dvb");
class_simple_destroy(dvb_class); class_destroy(dvb_class);
cdev_del(&dvb_device_cdev); cdev_del(&dvb_device_cdev);
unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS); unregister_chrdev_region(MKDEV(DVB_MAJOR, 0), MAX_DVB_MINORS);
} }
......
...@@ -273,7 +273,7 @@ static int ppp_connect_channel(struct channel *pch, int unit); ...@@ -273,7 +273,7 @@ static int ppp_connect_channel(struct channel *pch, int unit);
static int ppp_disconnect_channel(struct channel *pch); static int ppp_disconnect_channel(struct channel *pch);
static void ppp_destroy_channel(struct channel *pch); static void ppp_destroy_channel(struct channel *pch);
static struct class_simple *ppp_class; static struct class *ppp_class;
/* Translates a PPP protocol number to a NP index (NP == network protocol) */ /* Translates a PPP protocol number to a NP index (NP == network protocol) */
static inline int proto_to_npindex(int proto) static inline int proto_to_npindex(int proto)
...@@ -858,12 +858,12 @@ static int __init ppp_init(void) ...@@ -858,12 +858,12 @@ static int __init ppp_init(void)
printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n"); printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n");
err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops); err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops);
if (!err) { if (!err) {
ppp_class = class_simple_create(THIS_MODULE, "ppp"); ppp_class = class_create(THIS_MODULE, "ppp");
if (IS_ERR(ppp_class)) { if (IS_ERR(ppp_class)) {
err = PTR_ERR(ppp_class); err = PTR_ERR(ppp_class);
goto out_chrdev; goto out_chrdev;
} }
class_simple_device_add(ppp_class, MKDEV(PPP_MAJOR, 0), NULL, "ppp"); class_device_create(ppp_class, MKDEV(PPP_MAJOR, 0), NULL, "ppp");
err = devfs_mk_cdev(MKDEV(PPP_MAJOR, 0), err = devfs_mk_cdev(MKDEV(PPP_MAJOR, 0),
S_IFCHR|S_IRUSR|S_IWUSR, "ppp"); S_IFCHR|S_IRUSR|S_IWUSR, "ppp");
if (err) if (err)
...@@ -876,8 +876,8 @@ static int __init ppp_init(void) ...@@ -876,8 +876,8 @@ static int __init ppp_init(void)
return err; return err;
out_class: out_class:
class_simple_device_remove(MKDEV(PPP_MAJOR,0)); class_device_destroy(ppp_class, MKDEV(PPP_MAJOR,0));
class_simple_destroy(ppp_class); class_destroy(ppp_class);
out_chrdev: out_chrdev:
unregister_chrdev(PPP_MAJOR, "ppp"); unregister_chrdev(PPP_MAJOR, "ppp");
goto out; goto out;
...@@ -2654,8 +2654,8 @@ static void __exit ppp_cleanup(void) ...@@ -2654,8 +2654,8 @@ static void __exit ppp_cleanup(void)
if (unregister_chrdev(PPP_MAJOR, "ppp") != 0) if (unregister_chrdev(PPP_MAJOR, "ppp") != 0)
printk(KERN_ERR "PPP: failed to unregister PPP device\n"); printk(KERN_ERR "PPP: failed to unregister PPP device\n");
devfs_remove("ppp"); devfs_remove("ppp");
class_simple_device_remove(MKDEV(PPP_MAJOR, 0)); class_device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0));
class_simple_destroy(ppp_class); class_destroy(ppp_class);
} }
/* /*
......
...@@ -235,7 +235,7 @@ static int dma[MAX_CARDS+1]; ...@@ -235,7 +235,7 @@ static int dma[MAX_CARDS+1];
static int irq[MAX_CARDS+1] = { -1, -1, -1, -1, -1, -1, 0, }; static int irq[MAX_CARDS+1] = { -1, -1, -1, -1, -1, -1, 0, };
/* for class stuff*/ /* for class stuff*/
static struct class_simple *cosa_class; static struct class *cosa_class;
#ifdef MODULE #ifdef MODULE
module_param_array(io, int, NULL, 0); module_param_array(io, int, NULL, 0);
...@@ -394,19 +394,19 @@ static int __init cosa_init(void) ...@@ -394,19 +394,19 @@ static int __init cosa_init(void)
goto out; goto out;
} }
devfs_mk_dir("cosa"); devfs_mk_dir("cosa");
cosa_class = class_simple_create(THIS_MODULE, "cosa"); cosa_class = class_create(THIS_MODULE, "cosa");
if (IS_ERR(cosa_class)) { if (IS_ERR(cosa_class)) {
err = PTR_ERR(cosa_class); err = PTR_ERR(cosa_class);
goto out_chrdev; goto out_chrdev;
} }
for (i=0; i<nr_cards; i++) { for (i=0; i<nr_cards; i++) {
class_simple_device_add(cosa_class, MKDEV(cosa_major, i), class_device_create(cosa_class, MKDEV(cosa_major, i),
NULL, "cosa%d", i); NULL, "cosa%d", i);
err = devfs_mk_cdev(MKDEV(cosa_major, i), err = devfs_mk_cdev(MKDEV(cosa_major, i),
S_IFCHR|S_IRUSR|S_IWUSR, S_IFCHR|S_IRUSR|S_IWUSR,
"cosa/%d", i); "cosa/%d", i);
if (err) { if (err) {
class_simple_device_remove(MKDEV(cosa_major, i)); class_device_destroy(cosa_class, MKDEV(cosa_major, i));
goto out_chrdev; goto out_chrdev;
} }
} }
...@@ -427,10 +427,10 @@ static void __exit cosa_exit(void) ...@@ -427,10 +427,10 @@ static void __exit cosa_exit(void)
printk(KERN_INFO "Unloading the cosa module\n"); printk(KERN_INFO "Unloading the cosa module\n");
for (i=0; i<nr_cards; i++) { for (i=0; i<nr_cards; i++) {
class_simple_device_remove(MKDEV(cosa_major, i)); class_device_destroy(cosa_class, MKDEV(cosa_major, i));
devfs_remove("cosa/%d", i); devfs_remove("cosa/%d", i);
} }
class_simple_destroy(cosa_class); class_destroy(cosa_class);
devfs_remove("cosa"); devfs_remove("cosa");
for (cosa=cosa_cards; nr_cards--; cosa++) { for (cosa=cosa_cards; nr_cards--; cosa++) {
/* Clean up the per-channel data */ /* Clean up the per-channel data */
......
...@@ -16,7 +16,7 @@ MODULE_DESCRIPTION( ...@@ -16,7 +16,7 @@ MODULE_DESCRIPTION(
); );
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
struct class_simple *tape_class; static struct class *tape_class;
/* /*
* Register a tape device and return a pointer to the cdev structure. * Register a tape device and return a pointer to the cdev structure.
...@@ -70,7 +70,7 @@ struct tape_class_device *register_tape_dev( ...@@ -70,7 +70,7 @@ struct tape_class_device *register_tape_dev(
if (rc) if (rc)
goto fail_with_cdev; goto fail_with_cdev;
tcd->class_device = class_simple_device_add( tcd->class_device = class_device_create(
tape_class, tape_class,
tcd->char_device->dev, tcd->char_device->dev,
device, device,
...@@ -101,7 +101,7 @@ void unregister_tape_dev(struct tape_class_device *tcd) ...@@ -101,7 +101,7 @@ void unregister_tape_dev(struct tape_class_device *tcd)
&tcd->class_device->dev->kobj, &tcd->class_device->dev->kobj,
tcd->mode_name tcd->mode_name
); );
class_simple_device_remove(tcd->char_device->dev); class_device_destroy(tape_class, tcd->char_device->dev);
cdev_del(tcd->char_device); cdev_del(tcd->char_device);
kfree(tcd); kfree(tcd);
} }
...@@ -111,14 +111,14 @@ EXPORT_SYMBOL(unregister_tape_dev); ...@@ -111,14 +111,14 @@ EXPORT_SYMBOL(unregister_tape_dev);
static int __init tape_init(void) static int __init tape_init(void)
{ {
tape_class = class_simple_create(THIS_MODULE, "tape390"); tape_class = class_create(THIS_MODULE, "tape390");
return 0; return 0;
} }
static void __exit tape_exit(void) static void __exit tape_exit(void)
{ {
class_simple_destroy(tape_class); class_destroy(tape_class);
tape_class = NULL; tape_class = NULL;
} }
......
...@@ -703,7 +703,7 @@ static struct attribute_group vmlogrdr_attr_group = { ...@@ -703,7 +703,7 @@ static struct attribute_group vmlogrdr_attr_group = {
.attrs = vmlogrdr_attrs, .attrs = vmlogrdr_attrs,
}; };
static struct class_simple *vmlogrdr_class; static struct class *vmlogrdr_class;
static struct device_driver vmlogrdr_driver = { static struct device_driver vmlogrdr_driver = {
.name = "vmlogrdr", .name = "vmlogrdr",
.bus = &iucv_bus, .bus = &iucv_bus,
...@@ -727,7 +727,7 @@ vmlogrdr_register_driver(void) { ...@@ -727,7 +727,7 @@ vmlogrdr_register_driver(void) {
goto unregdriver; goto unregdriver;
} }
vmlogrdr_class = class_simple_create(THIS_MODULE, "vmlogrdr"); vmlogrdr_class = class_create(THIS_MODULE, "vmlogrdr");
if (IS_ERR(vmlogrdr_class)) { if (IS_ERR(vmlogrdr_class)) {
printk(KERN_ERR "vmlogrdr: failed to create class.\n"); printk(KERN_ERR "vmlogrdr: failed to create class.\n");
ret=PTR_ERR(vmlogrdr_class); ret=PTR_ERR(vmlogrdr_class);
...@@ -746,7 +746,7 @@ vmlogrdr_register_driver(void) { ...@@ -746,7 +746,7 @@ vmlogrdr_register_driver(void) {
static void static void
vmlogrdr_unregister_driver(void) { vmlogrdr_unregister_driver(void) {
class_simple_destroy(vmlogrdr_class); class_destroy(vmlogrdr_class);
vmlogrdr_class = NULL; vmlogrdr_class = NULL;
driver_remove_file(&vmlogrdr_driver, &driver_attr_recording_status); driver_remove_file(&vmlogrdr_driver, &driver_attr_recording_status);
driver_unregister(&vmlogrdr_driver); driver_unregister(&vmlogrdr_driver);
...@@ -786,7 +786,7 @@ vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) { ...@@ -786,7 +786,7 @@ vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) {
device_unregister(dev); device_unregister(dev);
return ret; return ret;
} }
priv->class_device = class_simple_device_add( priv->class_device = class_device_create(
vmlogrdr_class, vmlogrdr_class,
MKDEV(vmlogrdr_major, priv->minor_num), MKDEV(vmlogrdr_major, priv->minor_num),
dev, dev,
...@@ -806,7 +806,7 @@ vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) { ...@@ -806,7 +806,7 @@ vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) {
static int static int
vmlogrdr_unregister_device(struct vmlogrdr_priv_t *priv ) { vmlogrdr_unregister_device(struct vmlogrdr_priv_t *priv ) {
class_simple_device_remove(MKDEV(vmlogrdr_major, priv->minor_num)); class_device_destroy(vmlogrdr_class, MKDEV(vmlogrdr_major, priv->minor_num));
if (priv->device != NULL) { if (priv->device != NULL) {
sysfs_remove_group(&priv->device->kobj, &vmlogrdr_attr_group); sysfs_remove_group(&priv->device->kobj, &vmlogrdr_attr_group);
device_unregister(priv->device); device_unregister(priv->device);
......
...@@ -68,7 +68,7 @@ static struct file_operations usb_fops = { ...@@ -68,7 +68,7 @@ static struct file_operations usb_fops = {
.open = usb_open, .open = usb_open,
}; };
static struct class_simple *usb_class; static struct class *usb_class;
int usb_major_init(void) int usb_major_init(void)
{ {
...@@ -80,9 +80,9 @@ int usb_major_init(void) ...@@ -80,9 +80,9 @@ int usb_major_init(void)
goto out; goto out;
} }
usb_class = class_simple_create(THIS_MODULE, "usb"); usb_class = class_create(THIS_MODULE, "usb");
if (IS_ERR(usb_class)) { if (IS_ERR(usb_class)) {
err("class_simple_create failed for usb devices"); err("class_create failed for usb devices");
unregister_chrdev(USB_MAJOR, "usb"); unregister_chrdev(USB_MAJOR, "usb");
goto out; goto out;
} }
...@@ -95,7 +95,7 @@ int usb_major_init(void) ...@@ -95,7 +95,7 @@ int usb_major_init(void)
void usb_major_cleanup(void) void usb_major_cleanup(void)
{ {
class_simple_destroy(usb_class); class_destroy(usb_class);
devfs_remove("usb"); devfs_remove("usb");
unregister_chrdev(USB_MAJOR, "usb"); unregister_chrdev(USB_MAJOR, "usb");
} }
...@@ -171,7 +171,7 @@ int usb_register_dev(struct usb_interface *intf, ...@@ -171,7 +171,7 @@ int usb_register_dev(struct usb_interface *intf,
++temp; ++temp;
else else
temp = name; temp = name;
intf->class_dev = class_simple_device_add(usb_class, MKDEV(USB_MAJOR, minor), &intf->dev, "%s", temp); intf->class_dev = class_device_create(usb_class, MKDEV(USB_MAJOR, minor), &intf->dev, "%s", temp);
if (IS_ERR(intf->class_dev)) { if (IS_ERR(intf->class_dev)) {
spin_lock (&minor_lock); spin_lock (&minor_lock);
usb_minors[intf->minor] = NULL; usb_minors[intf->minor] = NULL;
...@@ -220,7 +220,7 @@ void usb_deregister_dev(struct usb_interface *intf, ...@@ -220,7 +220,7 @@ void usb_deregister_dev(struct usb_interface *intf,
snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base); snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base);
devfs_remove (name); devfs_remove (name);
class_simple_device_remove(MKDEV(USB_MAJOR, intf->minor)); class_device_destroy(usb_class, MKDEV(USB_MAJOR, intf->minor));
intf->class_dev = NULL; intf->class_dev = NULL;
intf->minor = -1; intf->minor = -1;
} }
......
...@@ -1040,7 +1040,7 @@ static struct file_operations fb_fops = { ...@@ -1040,7 +1040,7 @@ static struct file_operations fb_fops = {
#endif #endif
}; };
static struct class_simple *fb_class; static struct class *fb_class;
/** /**
* register_framebuffer - registers a frame buffer device * register_framebuffer - registers a frame buffer device
...@@ -1066,7 +1066,7 @@ register_framebuffer(struct fb_info *fb_info) ...@@ -1066,7 +1066,7 @@ register_framebuffer(struct fb_info *fb_info)
break; break;
fb_info->node = i; fb_info->node = i;
fb_info->class_device = class_simple_device_add(fb_class, MKDEV(FB_MAJOR, i), fb_info->class_device = class_device_create(fb_class, MKDEV(FB_MAJOR, i),
fb_info->device, "fb%d", i); fb_info->device, "fb%d", i);
if (IS_ERR(fb_info->class_device)) { if (IS_ERR(fb_info->class_device)) {
/* Not fatal */ /* Not fatal */
...@@ -1134,7 +1134,7 @@ unregister_framebuffer(struct fb_info *fb_info) ...@@ -1134,7 +1134,7 @@ unregister_framebuffer(struct fb_info *fb_info)
registered_fb[i]=NULL; registered_fb[i]=NULL;
num_registered_fb--; num_registered_fb--;
fb_cleanup_class_device(fb_info); fb_cleanup_class_device(fb_info);
class_simple_device_remove(MKDEV(FB_MAJOR, i)); class_device_destroy(fb_class, MKDEV(FB_MAJOR, i));
return 0; return 0;
} }
...@@ -1197,7 +1197,7 @@ fbmem_init(void) ...@@ -1197,7 +1197,7 @@ fbmem_init(void)
if (register_chrdev(FB_MAJOR,"fb",&fb_fops)) if (register_chrdev(FB_MAJOR,"fb",&fb_fops))
printk("unable to get major %d for fb devs\n", FB_MAJOR); printk("unable to get major %d for fb devs\n", FB_MAJOR);
fb_class = class_simple_create(THIS_MODULE, "graphics"); fb_class = class_create(THIS_MODULE, "graphics");
if (IS_ERR(fb_class)) { if (IS_ERR(fb_class)) {
printk(KERN_WARNING "Unable to create fb class; errno = %ld\n", PTR_ERR(fb_class)); printk(KERN_WARNING "Unable to create fb class; errno = %ld\n", PTR_ERR(fb_class));
fb_class = NULL; fb_class = NULL;
...@@ -1210,7 +1210,7 @@ module_init(fbmem_init); ...@@ -1210,7 +1210,7 @@ module_init(fbmem_init);
static void __exit static void __exit
fbmem_exit(void) fbmem_exit(void)
{ {
class_simple_destroy(fb_class); class_destroy(fb_class);
} }
module_exit(fbmem_exit); module_exit(fbmem_exit);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment