public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pwm: Remove a redundant error message when devm_request_and_ioremap fails
@ 2012-08-03 13:43 Axel Lin
  2012-08-03 15:37 ` Stephen Warren
  2012-08-09  5:41 ` Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-08-03 13:43 UTC (permalink / raw)
  To: Thierry Reding; +Cc: linux-kernel, Stephen Warren, Philip Avinash

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.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Philip, Avinash <avinashphilip@ti.com>
---
 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(-)

diff --git a/drivers/pwm/pwm-tegra.c b/drivers/pwm/pwm-tegra.c
index 02ce18d..057465e 100644
--- a/drivers/pwm/pwm-tegra.c
+++ b/drivers/pwm/pwm-tegra.c
@@ -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);
 
diff --git a/drivers/pwm/pwm-tiecap.c b/drivers/pwm/pwm-tiecap.c
index 3c2ad28..0b66d0f 100644
--- a/drivers/pwm/pwm-tiecap.c
+++ b/drivers/pwm/pwm-tiecap.c
@@ -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) {
diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c
index 010d232..c3756d1 100644
--- a/drivers/pwm/pwm-tiehrpwm.c
+++ b/drivers/pwm/pwm-tiehrpwm.c
@@ -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) {
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pwm: Remove a redundant error message when devm_request_and_ioremap fails
  2012-08-03 13:43 [PATCH] pwm: Remove a redundant error message when devm_request_and_ioremap fails Axel Lin
@ 2012-08-03 15:37 ` Stephen Warren
  2012-08-09  5:41 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2012-08-03 15:37 UTC (permalink / raw)
  To: Axel Lin; +Cc: Thierry Reding, linux-kernel, Philip Avinash

On 08/03/2012 07:43 AM, Axel Lin wrote:
> 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.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pwm: Remove a redundant error message when devm_request_and_ioremap fails
  2012-08-03 13:43 [PATCH] pwm: Remove a redundant error message when devm_request_and_ioremap fails Axel Lin
  2012-08-03 15:37 ` Stephen Warren
@ 2012-08-09  5:41 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2012-08-09  5:41 UTC (permalink / raw)
  To: Axel Lin; +Cc: linux-kernel, Stephen Warren, Philip Avinash

[-- Attachment #1: Type: text/plain, Size: 499 bytes --]

On Fri, Aug 03, 2012 at 09:43:54PM +0800, Axel Lin wrote:
> 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.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Philip, Avinash <avinashphilip@ti.com>
> ---

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

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-09  5:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-03 13:43 [PATCH] pwm: Remove a redundant error message when devm_request_and_ioremap fails Axel Lin
2012-08-03 15:37 ` Stephen Warren
2012-08-09  5:41 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox