media: staging: atomisp: Remove duplicate NULL-check
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 19 Dec 2017 20:59:49 +0000 (15:59 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 29 Dec 2017 11:25:04 +0000 (06:25 -0500)
GPIO framework checks for NULL pointer when gpiod_set_value() is called.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/staging/media/atomisp/platform/intel-mid/atomisp_gmin_platform.c

index a5d0dd88a8bceb0fefd92b866427922dc741e8b5..8fb5147531a5fc620f918a9c855a9db54f5f9f46 100644 (file)
@@ -394,7 +394,7 @@ static int gmin_gpio0_ctrl(struct v4l2_subdev *subdev, int on)
 {
        struct gmin_subdev *gs = find_gmin_subdev(subdev);
 
-       if (gs && gs->gpio0) {
+       if (gs) {
                gpiod_set_value(gs->gpio0, on);
                return 0;
        }
@@ -405,7 +405,7 @@ static int gmin_gpio1_ctrl(struct v4l2_subdev *subdev, int on)
 {
        struct gmin_subdev *gs = find_gmin_subdev(subdev);
 
-       if (gs && gs->gpio1) {
+       if (gs) {
                gpiod_set_value(gs->gpio1, on);
                return 0;
        }