diff mbox series

media: i2c: imx334: Fix an error message

Message ID YCJsUCngklBkJMgw@mwanda
State New
Headers show
Series media: i2c: imx334: Fix an error message | expand

Commit Message

Dan Carpenter Feb. 9, 2021, 11:04 a.m. UTC
The "ret" variable is uninitialized in this error message.

Fixes: 9746b11715c3 ("media: i2c: Add imx334 camera sensor driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
When new drivers are merged into the kernel, then could we use the
driver prefix?  In other words something like this:

media: i2c/imx334: Add imx334 camera sensor driver

 drivers/media/i2c/imx334.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Sakari Ailus Feb. 9, 2021, 12:08 p.m. UTC | #1
Hi Dan,

On Tue, Feb 09, 2021 at 02:04:48PM +0300, Dan Carpenter wrote:
> The "ret" variable is uninitialized in this error message.
> 
> Fixes: 9746b11715c3 ("media: i2c: Add imx334 camera sensor driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks for the patch. This has been already addressed by a patch from Hans
(but not merged yet):

<URL:https://patchwork.linuxtv.org/project/linux-media/patch/917ccfef-b93e-4d90-0b5a-4974145ab187@xs4all.nl/>

> ---
> When new drivers are merged into the kernel, then could we use the
> driver prefix?  In other words something like this:
> 
> media: i2c/imx334: Add imx334 camera sensor driver

We've usually had driver's name and Mauro's scripts add media: prefix ---
unless it's already there. Are you suggesting also the bus should be part
of it?
diff mbox series

Patch

diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c
index 07e31bc2ef18..7fbea7caef42 100644
--- a/drivers/media/i2c/imx334.c
+++ b/drivers/media/i2c/imx334.c
@@ -790,8 +790,9 @@  static int imx334_parse_hw_config(struct imx334 *imx334)
 	imx334->reset_gpio = devm_gpiod_get_optional(imx334->dev, "reset",
 						     GPIOD_OUT_LOW);
 	if (IS_ERR(imx334->reset_gpio)) {
+		ret = PTR_ERR(imx334->reset_gpio);
 		dev_err(imx334->dev, "failed to get reset gpio %d", ret);
-		return PTR_ERR(imx334->reset_gpio);
+		return ret;
 	}
 
 	/* Get sensor input clock */