diff options
author | Fabio Estevam <festevam@gmail.com> | 2019-05-31 20:45:04 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-26 10:12:30 +0300 |
commit | 5b41a2ede7b1bfd760156432ef04a954b5055ede (patch) | |
tree | ce062083bcb62f6bf65c91194c5f9376fbed7f5c /drivers/staging/media | |
parent | 37243454d0be784b1e4f51b1e194e2937f531eec (diff) | |
download | linux-5b41a2ede7b1bfd760156432ef04a954b5055ede.tar.xz |
media: imx7-mipi-csis: Propagate the error if clock enabling fails
[ Upstream commit 2b393f91c651c16d5c09f5c7aa689e58a79df34e ]
Currently the return value from clk_bulk_prepare_enable() is checked,
but it is not propagate it in the case of failure.
Fix it and also move the error message to the caller of
mipi_csis_clk_enable().
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/staging/media')
-rw-r--r-- | drivers/staging/media/imx/imx7-mipi-csis.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c index 2ddcc42ab8ff..e9d621e19d6d 100644 --- a/drivers/staging/media/imx/imx7-mipi-csis.c +++ b/drivers/staging/media/imx/imx7-mipi-csis.c @@ -455,13 +455,9 @@ static void mipi_csis_set_params(struct csi_state *state) MIPI_CSIS_CMN_CTRL_UPDATE_SHADOW_CTRL); } -static void mipi_csis_clk_enable(struct csi_state *state) +static int mipi_csis_clk_enable(struct csi_state *state) { - int ret; - - ret = clk_bulk_prepare_enable(state->num_clks, state->clks); - if (ret < 0) - dev_err(state->dev, "failed to enable clocks\n"); + return clk_bulk_prepare_enable(state->num_clks, state->clks); } static void mipi_csis_clk_disable(struct csi_state *state) @@ -985,7 +981,11 @@ static int mipi_csis_probe(struct platform_device *pdev) if (ret < 0) return ret; - mipi_csis_clk_enable(state); + ret = mipi_csis_clk_enable(state); + if (ret < 0) { + dev_err(state->dev, "failed to enable clocks: %d\n", ret); + return ret; + } ret = devm_request_irq(dev, state->irq, mipi_csis_irq_handler, 0, dev_name(dev), state); |