media: lirc: move lirc_dev->attached to rc_dev->registered

This is done to further remove the lirc kernel api. Ensure that every
fops checks for this.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
Sean Young
2017-09-26 07:31:29 -04:00
committed by Mauro Carvalho Chehab
parent 71695aff9f
commit 7790e81f7e
5 changed files with 24 additions and 11 deletions

View File

@@ -122,7 +122,6 @@ int lirc_register_device(struct lirc_dev *d)
cdev_init(&d->cdev, d->fops);
d->cdev.owner = d->owner;
d->attached = true;
err = cdev_device_add(&d->cdev, &d->dev);
if (err) {
@@ -153,7 +152,6 @@ void lirc_unregister_device(struct lirc_dev *d)
mutex_lock(&d->mutex);
d->attached = false;
if (d->open) {
dev_dbg(&d->dev, LOGHEAD "releasing opened driver\n",
d->name, d->minor);
@@ -180,7 +178,7 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file)
if (retval)
return retval;
if (!d->attached) {
if (!rcdev->registered) {
retval = -ENODEV;
goto out;
}