mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 01:49:36 +00:00
[media] media: lirc_dev: use cdev_device_add() helper function
Replace calls to cdev_add() and device_add() with the cdev_device_add() helper function. Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
c3c6dd750e
commit
0510d81081
1 changed files with 4 additions and 13 deletions
|
@ -193,17 +193,11 @@ int lirc_register_driver(struct lirc_driver *d)
|
|||
|
||||
cdev_init(&ir->cdev, d->fops);
|
||||
ir->cdev.owner = ir->d.owner;
|
||||
ir->cdev.kobj.parent = &ir->dev.kobj;
|
||||
|
||||
err = cdev_add(&ir->cdev, ir->dev.devt, 1);
|
||||
if (err)
|
||||
goto out_free_dev;
|
||||
|
||||
ir->attached = 1;
|
||||
|
||||
err = device_add(&ir->dev);
|
||||
err = cdev_device_add(&ir->cdev, &ir->dev);
|
||||
if (err)
|
||||
goto out_cdev;
|
||||
goto out_dev;
|
||||
|
||||
mutex_unlock(&lirc_dev_lock);
|
||||
|
||||
|
@ -214,9 +208,7 @@ int lirc_register_driver(struct lirc_driver *d)
|
|||
|
||||
return 0;
|
||||
|
||||
out_cdev:
|
||||
cdev_del(&ir->cdev);
|
||||
out_free_dev:
|
||||
out_dev:
|
||||
put_device(&ir->dev);
|
||||
out_lock:
|
||||
mutex_unlock(&lirc_dev_lock);
|
||||
|
@ -248,8 +240,7 @@ void lirc_unregister_driver(struct lirc_driver *d)
|
|||
|
||||
mutex_unlock(&lirc_dev_lock);
|
||||
|
||||
device_del(&ir->dev);
|
||||
cdev_del(&ir->cdev);
|
||||
cdev_device_del(&ir->cdev, &ir->dev);
|
||||
put_device(&ir->dev);
|
||||
}
|
||||
EXPORT_SYMBOL(lirc_unregister_driver);
|
||||
|
|
Loading…
Reference in a new issue