]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: most: v4l2-aim: remove unnecessary retval
authorChristian Gromm <christian.gromm@microchip.com>
Mon, 6 Jun 2016 13:23:09 +0000 (15:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Aug 2016 17:17:04 +0000 (19:17 +0200)
The function aim_register_videodev() uses the variables 'ret' and
'retval' to represent the same value.

This patch removes 'retval' and replaces it with 'ret'. Further, it
replaces the constant return value '-ENODEV' with the result returned by
function video_register_device() in the event something went wrong.

Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de>
Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/aim-v4l2/video.c

index b55ab62459e116e546cc0d6b7a1295750f025bd7..e0fee8807312a2f83fa6ba699e0dee8651bcff1e 100644 (file)
@@ -439,7 +439,6 @@ static int aim_rx_data(struct mbo *mbo)
 
 static int aim_register_videodev(struct most_video_dev *mdev)
 {
-       int retval = -ENOMEM;
        int ret;
 
        v4l2_info(&mdev->v4l2_dev, "aim_register_videodev()\n");
@@ -460,11 +459,10 @@ static int aim_register_videodev(struct most_video_dev *mdev)
 
        /* Register the v4l2 device */
        video_set_drvdata(mdev->vdev, mdev);
-       retval = video_register_device(mdev->vdev, VFL_TYPE_GRABBER, -1);
-       if (retval != 0) {
+       ret = video_register_device(mdev->vdev, VFL_TYPE_GRABBER, -1);
+       if (ret) {
                v4l2_err(&mdev->v4l2_dev, "video_register_device failed (%d)\n",
-                        retval);
-               ret = -ENODEV;
+                        ret);
                goto err_vbi_dev;
        }