aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/raw.c')
-rw-r--r--drivers/char/raw.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index ca5f42bcaad9..f13e5de02207 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -27,7 +27,7 @@ struct raw_device_data {
27 int inuse; 27 int inuse;
28}; 28};
29 29
30static struct class_simple *raw_class; 30static struct class *raw_class;
31static struct raw_device_data raw_devices[MAX_RAW_MINORS]; 31static struct raw_device_data raw_devices[MAX_RAW_MINORS];
32static DECLARE_MUTEX(raw_mutex); 32static DECLARE_MUTEX(raw_mutex);
33static struct file_operations raw_ctl_fops; /* forward declaration */ 33static struct file_operations raw_ctl_fops; /* forward declaration */
@@ -127,8 +127,8 @@ raw_ioctl(struct inode *inode, struct file *filp,
127 127
128static void bind_device(struct raw_config_request *rq) 128static void bind_device(struct raw_config_request *rq)
129{ 129{
130 class_simple_device_remove(MKDEV(RAW_MAJOR, rq->raw_minor)); 130 class_device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor));
131 class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor), 131 class_device_create(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor),
132 NULL, "raw%d", rq->raw_minor); 132 NULL, "raw%d", rq->raw_minor);
133} 133}
134 134
@@ -200,8 +200,8 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp,
200 if (rq.block_major == 0 && rq.block_minor == 0) { 200 if (rq.block_major == 0 && rq.block_minor == 0) {
201 /* unbind */ 201 /* unbind */
202 rawdev->binding = NULL; 202 rawdev->binding = NULL;
203 class_simple_device_remove(MKDEV(RAW_MAJOR, 203 class_device_destroy(raw_class,
204 rq.raw_minor)); 204 MKDEV(RAW_MAJOR, rq.raw_minor));
205 } else { 205 } else {
206 rawdev->binding = bdget(dev); 206 rawdev->binding = bdget(dev);
207 if (rawdev->binding == NULL) 207 if (rawdev->binding == NULL)
@@ -300,14 +300,14 @@ static int __init raw_init(void)
300 goto error; 300 goto error;
301 } 301 }
302 302
303 raw_class = class_simple_create(THIS_MODULE, "raw"); 303 raw_class = class_create(THIS_MODULE, "raw");
304 if (IS_ERR(raw_class)) { 304 if (IS_ERR(raw_class)) {
305 printk(KERN_ERR "Error creating raw class.\n"); 305 printk(KERN_ERR "Error creating raw class.\n");
306 cdev_del(&raw_cdev); 306 cdev_del(&raw_cdev);
307 unregister_chrdev_region(dev, MAX_RAW_MINORS); 307 unregister_chrdev_region(dev, MAX_RAW_MINORS);
308 goto error; 308 goto error;
309 } 309 }
310 class_simple_device_add(raw_class, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); 310 class_device_create(raw_class, MKDEV(RAW_MAJOR, 0), NULL, "rawctl");
311 311
312 devfs_mk_cdev(MKDEV(RAW_MAJOR, 0), 312 devfs_mk_cdev(MKDEV(RAW_MAJOR, 0),
313 S_IFCHR | S_IRUGO | S_IWUGO, 313 S_IFCHR | S_IRUGO | S_IWUGO,
@@ -331,8 +331,8 @@ static void __exit raw_exit(void)
331 devfs_remove("raw/raw%d", i); 331 devfs_remove("raw/raw%d", i);
332 devfs_remove("raw/rawctl"); 332 devfs_remove("raw/rawctl");
333 devfs_remove("raw"); 333 devfs_remove("raw");
334 class_simple_device_remove(MKDEV(RAW_MAJOR, 0)); 334 class_device_destroy(raw_class, MKDEV(RAW_MAJOR, 0));
335 class_simple_destroy(raw_class); 335 class_destroy(raw_class);
336 cdev_del(&raw_cdev); 336 cdev_del(&raw_cdev);
337 unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS); 337 unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS);
338} 338}