Commit 38ca6c34 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Driver core: convert raw device code to use struct device

Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 01107d34
...@@ -127,9 +127,9 @@ raw_ioctl(struct inode *inode, struct file *filp, ...@@ -127,9 +127,9 @@ raw_ioctl(struct inode *inode, struct file *filp,
static void bind_device(struct raw_config_request *rq) static void bind_device(struct raw_config_request *rq)
{ {
class_device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor)); device_destroy(raw_class, MKDEV(RAW_MAJOR, rq->raw_minor));
class_device_create(raw_class, NULL, MKDEV(RAW_MAJOR, rq->raw_minor), device_create(raw_class, NULL, MKDEV(RAW_MAJOR, rq->raw_minor),
NULL, "raw%d", rq->raw_minor); "raw%d", rq->raw_minor);
} }
/* /*
...@@ -200,7 +200,7 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp, ...@@ -200,7 +200,7 @@ static int raw_ctl_ioctl(struct inode *inode, struct file *filp,
if (rq.block_major == 0 && rq.block_minor == 0) { if (rq.block_major == 0 && rq.block_minor == 0) {
/* unbind */ /* unbind */
rawdev->binding = NULL; rawdev->binding = NULL;
class_device_destroy(raw_class, device_destroy(raw_class,
MKDEV(RAW_MAJOR, rq.raw_minor)); MKDEV(RAW_MAJOR, rq.raw_minor));
} else { } else {
rawdev->binding = bdget(dev); rawdev->binding = bdget(dev);
...@@ -283,7 +283,7 @@ static int __init raw_init(void) ...@@ -283,7 +283,7 @@ static int __init raw_init(void)
ret = PTR_ERR(raw_class); ret = PTR_ERR(raw_class);
goto error_region; goto error_region;
} }
class_device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), NULL, "rawctl"); device_create(raw_class, NULL, MKDEV(RAW_MAJOR, 0), "rawctl");
return 0; return 0;
...@@ -295,7 +295,7 @@ error: ...@@ -295,7 +295,7 @@ error:
static void __exit raw_exit(void) static void __exit raw_exit(void)
{ {
class_device_destroy(raw_class, MKDEV(RAW_MAJOR, 0)); device_destroy(raw_class, MKDEV(RAW_MAJOR, 0));
class_destroy(raw_class); class_destroy(raw_class);
cdev_del(&raw_cdev); cdev_del(&raw_cdev);
unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS); unregister_chrdev_region(MKDEV(RAW_MAJOR, 0), MAX_RAW_MINORS);
......
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