Commit 80bd81cb authored by Uwe Kleine-König's avatar Uwe Kleine-König

pwm: stm32: Add error messages in .probe()'s error paths

Giving an indication about the problem if probing a device fails is a
nice move. Do that for the stm32 pwm driver.
Reviewed-by: default avatarFabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20240315145443.982807-2-u.kleine-koenig@pengutronix.deSigned-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent 38ae7142
......@@ -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);
......
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