aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2024-03-15 15:54:43 +0100
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2024-04-22 12:42:25 +0200
commit871a7de7fc08f2c9395059928736cacac2ac5271 (patch)
treeebab8e426cc3deb7d15d30af31a64fab8e6bed8f
parent24626c4e685b45614118144c65511aacde3b1599 (diff)
downloadrenesas-drivers-871a7de7fc08f2c9395059928736cacac2ac5271.tar.gz
pwm: stm32: Add error messages in .probe()'s error paths
Notice: this object is not reachable from any branch.
Giving an indication about the problem if probing a device fails is a nice move. Do that for the stm32 pwm driver. Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Link: https://lore.kernel.org/r/20240315145443.982807-2-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Notice: this object is not reachable from any branch.
-rw-r--r--drivers/pwm/pwm-stm32.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
index 0c028d17c0752..ffe572b76174a 100644
--- a/drivers/pwm/pwm-stm32.c
+++ b/drivers/pwm/pwm-stm32.c
@@ -648,11 +648,13 @@ static int stm32_pwm_probe(struct platform_device *pdev)
priv->max_arr = ddata->max_arr;
if (!priv->regmap || !priv->clk)
- return -EINVAL;
+ return dev_err_probe(dev, -EINVAL, "Failed to get %s\n",
+ priv->regmap ? "clk" : "regmap");
ret = stm32_pwm_probe_breakinputs(priv, np);
if (ret)
- return ret;
+ return dev_err_probe(dev, ret,
+ "Failed to configure breakinputs\n");
stm32_pwm_detect_complementary(priv);
@@ -664,7 +666,8 @@ static int stm32_pwm_probe(struct platform_device *pdev)
ret = devm_pwmchip_add(dev, chip);
if (ret < 0)
- return ret;
+ return dev_err_probe(dev, ret,
+ "Failed to register pwmchip\n");
platform_set_drvdata(pdev, chip);