linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] ov5640: Remove unneeded gpiod NULL check
@ 2017-07-20  2:41 Fabio Estevam
  2017-07-22 18:36 ` Steve Longerbeam
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2017-07-20  2:41 UTC (permalink / raw)
  To: hans.verkuil; +Cc: slongerbeam, mchehab, linux-media, Fabio Estevam

From: Fabio Estevam <fabio.estevam@nxp.com>

The gpiod API checks for NULL descriptors, so there is no need to
duplicate the check in the driver.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 drivers/media/i2c/ov5640.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
index 1f5b483..39a2269 100644
--- a/drivers/media/i2c/ov5640.c
+++ b/drivers/media/i2c/ov5640.c
@@ -1524,8 +1524,7 @@ static int ov5640_restore_mode(struct ov5640_dev *sensor)
 
 static void ov5640_power(struct ov5640_dev *sensor, bool enable)
 {
-	if (sensor->pwdn_gpio)
-		gpiod_set_value(sensor->pwdn_gpio, enable ? 0 : 1);
+	gpiod_set_value(sensor->pwdn_gpio, enable ? 0 : 1);
 }
 
 static void ov5640_reset(struct ov5640_dev *sensor)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [media] ov5640: Remove unneeded gpiod NULL check
  2017-07-20  2:41 [PATCH] [media] ov5640: Remove unneeded gpiod NULL check Fabio Estevam
@ 2017-07-22 18:36 ` Steve Longerbeam
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Longerbeam @ 2017-07-22 18:36 UTC (permalink / raw)
  To: Fabio Estevam, hans.verkuil; +Cc: mchehab, linux-media, Fabio Estevam

Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com>

On 07/19/2017 07:41 PM, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> The gpiod API checks for NULL descriptors, so there is no need to
> duplicate the check in the driver.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
>   drivers/media/i2c/ov5640.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c
> index 1f5b483..39a2269 100644
> --- a/drivers/media/i2c/ov5640.c
> +++ b/drivers/media/i2c/ov5640.c
> @@ -1524,8 +1524,7 @@ static int ov5640_restore_mode(struct ov5640_dev *sensor)
>   
>   static void ov5640_power(struct ov5640_dev *sensor, bool enable)
>   {
> -	if (sensor->pwdn_gpio)
> -		gpiod_set_value(sensor->pwdn_gpio, enable ? 0 : 1);
> +	gpiod_set_value(sensor->pwdn_gpio, enable ? 0 : 1);
>   }
>   
>   static void ov5640_reset(struct ov5640_dev *sensor)
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-22 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-20  2:41 [PATCH] [media] ov5640: Remove unneeded gpiod NULL check Fabio Estevam
2017-07-22 18:36 ` Steve Longerbeam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).