Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 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>

+6 -3
+6 -3
drivers/pwm/pwm-stm32.c
··· 648 648 priv->max_arr = ddata->max_arr; 649 649 650 650 if (!priv->regmap || !priv->clk) 651 - return -EINVAL; 651 + return dev_err_probe(dev, -EINVAL, "Failed to get %s\n", 652 + priv->regmap ? "clk" : "regmap"); 652 653 653 654 ret = stm32_pwm_probe_breakinputs(priv, np); 654 655 if (ret) 655 - return ret; 656 + return dev_err_probe(dev, ret, 657 + "Failed to configure breakinputs\n"); 656 658 657 659 stm32_pwm_detect_complementary(priv); 658 660 ··· 666 664 667 665 ret = devm_pwmchip_add(dev, chip); 668 666 if (ret < 0) 669 - return ret; 667 + return dev_err_probe(dev, ret, 668 + "Failed to register pwmchip\n"); 670 669 671 670 platform_set_drvdata(pdev, chip); 672 671