[media] lirc_dev: merge three if statements in only one
authorAndi Shyti <andi.shyti@samsung.com>
Wed, 6 Jul 2016 09:01:21 +0000 (06:01 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 13 Jul 2016 18:24:28 +0000 (15:24 -0300)
The three if statements check the same thing, merge them in only
one statement.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/lirc_dev.c

index a8a5116d96691f0da106043d4e309ccac3e04d32..71ff82028c80583721d8b7325f91eb19dde5bac3 100644 (file)
@@ -270,15 +270,10 @@ static int lirc_allocate_driver(struct lirc_driver *d)
                        dev_err(d->dev, "add_to_buf not set\n");
                        return -EBADRQC;
                }
-       } else if (!(d->fops && d->fops->read) && !d->rbuf) {
-               dev_err(d->dev, "fops->read and rbuf are NULL!\n");
+       } else if (!d->rbuf && !(d->fops && d->fops->read &&
+                               d->fops->poll && d->fops->unlocked_ioctl)) {
+               dev_err(d->dev, "undefined read, poll, ioctl\n");
                return -EBADRQC;
-       } else if (!d->rbuf) {
-               if (!(d->fops && d->fops->read && d->fops->poll &&
-                     d->fops->unlocked_ioctl)) {
-                       dev_err(d->dev, "undefined read, poll, ioctl\n");
-                       return -EBADRQC;
-               }
        }
 
        mutex_lock(&lirc_dev_lock);