All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] media: i2c: Add imx334 camera sensor driver
@ 2021-02-09 10:54 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-02-09 10:54 UTC (permalink / raw)
  To: martinax.krasteva; +Cc: linux-media

Hello Martina Krasteva,

The patch 9746b11715c3: "media: i2c: Add imx334 camera sensor driver"
from Feb 3, 2021, leads to the following static checker warning:

	drivers/media/i2c/imx334.c:721 imx334_set_stream()
	warn: pm_runtime_get_sync() also returns 1 on success

drivers/media/i2c/imx334.c
   707  static int imx334_set_stream(struct v4l2_subdev *sd, int enable)
   708  {
   709          struct imx334 *imx334 = to_imx334(sd);
   710          int ret;
   711  
   712          mutex_lock(&imx334->mutex);
   713  
   714          if (imx334->streaming == enable) {
   715                  mutex_unlock(&imx334->mutex);
   716                  return 0;
   717          }
   718  
   719          if (enable) {
   720                  ret = pm_runtime_get_sync(imx334->dev);
   721                  if (ret)

This needs to be: "if (ret < 0)"

   722                          goto error_power_off;
   723  
   724                  ret = imx334_start_streaming(imx334);
   725                  if (ret)
   726                          goto error_power_off;
   727          } else {
   728                  imx334_stop_streaming(imx334);
   729                  pm_runtime_put(imx334->dev);
   730          }
   731  
   732          imx334->streaming = enable;
   733  
   734          mutex_unlock(&imx334->mutex);
   735  
   736          return 0;
   737  
   738  error_power_off:
   739          pm_runtime_put(imx334->dev);
   740          mutex_unlock(&imx334->mutex);
   741  
   742          return ret;
   743  }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-09 10:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-09 10:54 [bug report] media: i2c: Add imx334 camera sensor driver Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.