pwm: Remove a redundant error message when devm_request_and_ioremap fails
Subsystems (3)
PATCH 1/1 pwm: Remove a redundant error message when devm_request_and_ioremap fails
The implementation in devm_request_and_ioremap() already shows error message, so no need to show dev_err again if devm_request_and_ioremap() fails.
--- drivers/pwm/pwm-tegra.c | 4 +--- drivers/pwm/pwm-tiecap.c | 4 +--- drivers/pwm/pwm-tiehrpwm.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-)
drivers/pwm/pwm-tegra.c +1 -3
@@ -187,10 +187,8 @@ static int tegra_pwm_probe(struct platform_device *pdev) } pwm->mmio_base =devm_request_and_ioremap (&pdev->dev, r); -if (!pwm->mmio_base) { -dev_err (&pdev->dev,"failed to ioremap() region\n" ); +if (!pwm->mmio_base)return -EADDRNOTAVAIL ; - }platform_set_drvdata (pdev, pwm);
drivers/pwm/pwm-tiecap.c +1 -3
@@ -192,10 +192,8 @@ static int __devinit ecap_pwm_probe(struct platform_device *pdev) } pc->mmio_base =devm_request_and_ioremap (&pdev->dev, r); -if (!pc->mmio_base) { -dev_err (&pdev->dev,"failed to ioremap() registers\n" ); +if (!pc->mmio_base)return -EADDRNOTAVAIL ; - } ret =pwmchip_add (&pc->chip);if (ret <0 ) {
drivers/pwm/pwm-tiehrpwm.c +1 -3
@@ -371,10 +371,8 @@ static int __devinit ehrpwm_pwm_probe(struct platform_device *pdev) } pc->mmio_base =devm_request_and_ioremap (&pdev->dev, r); -if (!pc->mmio_base) { -dev_err (&pdev->dev,"failed to ioremap() registers\n" ); +if (!pc->mmio_base)return -EADDRNOTAVAIL ; - } ret =pwmchip_add (&pc->chip);if (ret <0 ) {
Signature · 1 line
1.7.9.5
Quoted 2 lines · Axel Lin
The implementation in
devm_request_and_ioremap()already shows error message, so no need to showdev_erragain ifdevm_request_and_ioremap()fails.
I don't have any issue with this patch, but a general comment:
It sure would be nice if there was some way to easily tell which functions did already print an error message. In some drivers I've written, I've made sure that every failure path prints an error message so it's easy to track down failures. However, if some functions already do this and some don't, only some call sites in the driver will have error prints, so it'll look inconsistent, as if some error messages were forgotten:-(
Thierry Reding
AppliedQuoted 7 lines · Axel Lin
The implementation in
devm_request_and_ioremap()already shows error message, so no need to showdev_erragain ifdevm_request_and_ioremap()fails.Signed-off-by Axel Lin <[email protected]>Cc Stephen Warren <[email protected]>Cc Philip, Avinash <[email protected]>---
Applied, thanks. I'll carry this in for-next and master. I collect fixes in the latter and plan to submit them for 3.6.
Thierry