diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index 0df46a1af5f0..1ad0246764a6 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -871,6 +871,9 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on) int ret; int value; + if (WARN_ON(!gs)) + return -ENODEV; + if (gs->v2p8_gpio >= 0) { pr_info("atomisp_gmin_platform: 2.8v power on GPIO %d\n", gs->v2p8_gpio); @@ -881,7 +884,7 @@ static int gmin_v2p8_ctrl(struct v4l2_subdev *subdev, int on) pr_err("V2P8 GPIO initialization failed\n"); } - if (!gs || gs->v2p8_on == on) + if (gs->v2p8_on == on) return 0; gs->v2p8_on = on; |