mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
media: i2c: imx290: Use dev_err_probe()
Improve error handling in the probe() function with dev_err_probe(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
6b69c52277
commit
63127235be
1 changed files with 8 additions and 12 deletions
|
@ -1224,10 +1224,9 @@ static int imx290_probe(struct i2c_client *client)
|
||||||
|
|
||||||
/* get system clock (xclk) */
|
/* get system clock (xclk) */
|
||||||
imx290->xclk = devm_clk_get(dev, "xclk");
|
imx290->xclk = devm_clk_get(dev, "xclk");
|
||||||
if (IS_ERR(imx290->xclk)) {
|
if (IS_ERR(imx290->xclk))
|
||||||
dev_err(dev, "Could not get xclk");
|
return dev_err_probe(dev, PTR_ERR(imx290->xclk),
|
||||||
return PTR_ERR(imx290->xclk);
|
"Could not get xclk");
|
||||||
}
|
|
||||||
|
|
||||||
ret = fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency",
|
ret = fwnode_property_read_u32(dev_fwnode(dev), "clock-frequency",
|
||||||
&xclk_freq);
|
&xclk_freq);
|
||||||
|
@ -1250,17 +1249,14 @@ static int imx290_probe(struct i2c_client *client)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = imx290_get_regulators(dev, imx290);
|
ret = imx290_get_regulators(dev, imx290);
|
||||||
if (ret < 0) {
|
if (ret < 0)
|
||||||
dev_err(dev, "Cannot get regulators\n");
|
return dev_err_probe(dev, ret, "Cannot get regulators\n");
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
imx290->rst_gpio = devm_gpiod_get_optional(dev, "reset",
|
imx290->rst_gpio = devm_gpiod_get_optional(dev, "reset",
|
||||||
GPIOD_OUT_HIGH);
|
GPIOD_OUT_HIGH);
|
||||||
if (IS_ERR(imx290->rst_gpio)) {
|
if (IS_ERR(imx290->rst_gpio))
|
||||||
dev_err(dev, "Cannot get reset gpio\n");
|
return dev_err_probe(dev, PTR_ERR(imx290->rst_gpio),
|
||||||
return PTR_ERR(imx290->rst_gpio);
|
"Cannot get reset gpio\n");
|
||||||
}
|
|
||||||
|
|
||||||
mutex_init(&imx290->lock);
|
mutex_init(&imx290->lock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue