Commit 2f47786c authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding

pwm: mtk-disp: Propagate errors in .get_state() to the caller

.get_state() can return an error indication. Make use of it to propagate
failing hardware accesses.
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: default avatarConor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20221130152148.2769768-9-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 51b9f2fb
...@@ -184,14 +184,14 @@ static int mtk_disp_pwm_get_state(struct pwm_chip *chip, ...@@ -184,14 +184,14 @@ static int mtk_disp_pwm_get_state(struct pwm_chip *chip,
err = clk_prepare_enable(mdp->clk_main); err = clk_prepare_enable(mdp->clk_main);
if (err < 0) { if (err < 0) {
dev_err(chip->dev, "Can't enable mdp->clk_main: %pe\n", ERR_PTR(err)); dev_err(chip->dev, "Can't enable mdp->clk_main: %pe\n", ERR_PTR(err));
return 0; return err;
} }
err = clk_prepare_enable(mdp->clk_mm); err = clk_prepare_enable(mdp->clk_mm);
if (err < 0) { if (err < 0) {
dev_err(chip->dev, "Can't enable mdp->clk_mm: %pe\n", ERR_PTR(err)); dev_err(chip->dev, "Can't enable mdp->clk_mm: %pe\n", ERR_PTR(err));
clk_disable_unprepare(mdp->clk_main); clk_disable_unprepare(mdp->clk_main);
return 0; return err;
} }
rate = clk_get_rate(mdp->clk_main); rate = clk_get_rate(mdp->clk_main);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment