mmc/host/sdhci-of-arasan.c: Use signed formatting in error messages
Subsystems (3)
PATCH 1/2 mmc/host/sdhci-of-arasan.c: Use signed formatting in error messages
"ret" is a signed int, so use "%d" in format strings instead of "%u". This prevents cryptic codes in error messages like this:
sdhci-arasan e0101000.sdhci: platform register failed (4294966779)
--- drivers/mmc/host/sdhci-of-arasan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +2 -2
@@ -161,7 +161,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev) host =sdhci_pltfm_init (pdev, &sdhci_arasan_pdata,0 );if (IS_ERR (host)) { ret =PTR_ERR (host); -dev_err (&pdev->dev,"platform init failed (%u)\n" , ret); +dev_err (&pdev->dev,"platform init failed (%d)\n" , ret); goto clk_disable_all; }
@@ -172,7 +172,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev) ret =sdhci_add_host (host);if (ret) { -dev_err (&pdev->dev,"platform register failed (%u)\n" , ret); +dev_err (&pdev->dev,"platform register failed (%d)\n" , ret); goto err_pltfm_free; }
Signature · 1 line
1.7.9.5
PATCH 2/2 mmc/host/sdhci-of-arasan.c: Skip EPROBE_DEFER error messages
When the error code is -EPROBE_DEFER, this will already be reported so don't emit an error message in that case.
--- drivers/mmc/host/sdhci-of-arasan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +4 -2
@@ -161,7 +161,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) host =sdhci_pltfm_init (pdev, &sdhci_arasan_pdata,0 );if (IS_ERR (host)) { ret =PTR_ERR (host); -dev_err (&pdev->dev,"platform init failed (%d)\n" , ret); +if (ret != -EPROBE_DEFER ) +dev_err (&pdev->dev,"platform init failed (%d)\n" , ret); goto clk_disable_all; }
@@ -172,7 +173,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) ret =sdhci_add_host (host);if (ret) { -dev_err (&pdev->dev,"platform register failed (%d)\n" , ret); +if (ret != -EPROBE_DEFER ) +dev_err (&pdev->dev,"platform register failed (%d)\n" , ret); goto err_pltfm_free; }
Signature · 1 line
1.7.9.5
Re: [PATCH 2/2] mmc/host/sdhci-of-arasan.c: Skip EPROBE_DEFER error messages
Hi Chris,
Quoted 23 lines · Mike Looijmans
When the error code is -EPROBE_DEFER, this will already be reported so don't emit an error message in that case.
Signed-off-by Mike Looijmans <[email protected]>--- drivers/mmc/host/sdhci-of-arasan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/mmc/host/sdhci-of-arasan.c +2
-1@@ -161,7 +161,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) host =sdhci_pltfm_init (pdev, &sdhci_arasan_pdata,0 );if (IS_ERR (host)) { ret =PTR_ERR (host); -dev_err (&pdev->dev,"platform init failed (%d)\n" , ret); +if (ret != -EPROBE_DEFER ) +dev_err (&pdev->dev,"platform init failed (%d)\n" , ret); goto clk_disable_all; }
drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_probe(struct platform_device *pdev) · line 179
Quoted 8 lines
drivers/mmc/host/sdhci-of-arasan.c +2
-1@@ -172,7 +173,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) ret =sdhci_add_host (host);if (ret) { -dev_err (&pdev->dev,"platform register failed (%d)\n" , ret); +if (ret != -EPROBE_DEFER ) +dev_err (&pdev->dev,"platform register failed (%d)\n" , ret); goto err_pltfm_free; }
I checked other drivers and they are not reporting these bugs. I have briefly looked at sdhci_add_host and sdhci_platfm_init and they are pretty good error description
+ core itself should report if driver probe failed.
That's why I think that it is just reasonable to remove these both dev_err completely.
What do you think?
Thanks,
Michal
Re: [PATCH 2/2] mmc/host/sdhci-of-arasan.c: Skip EPROBE_DEFER error messages
Quoted 41 lines · Michal Simek
Hi Chris,
Quoted 23 lines · Mike Looijmans
When the error code is -EPROBE_DEFER, this will already be reported so don't emit an error message in that case.
Signed-off-by Mike Looijmans <[email protected]>--- drivers/mmc/host/sdhci-of-arasan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/mmc/host/sdhci-of-arasan.c +2
-1@@ -161,7 +161,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) host =sdhci_pltfm_init (pdev, &sdhci_arasan_pdata,0 );if (IS_ERR (host)) { ret =PTR_ERR (host); -dev_err (&pdev->dev,"platform init failed (%d)\n" , ret); +if (ret != -EPROBE_DEFER ) +dev_err (&pdev->dev,"platform init failed (%d)\n" , ret); goto clk_disable_all; }drivers/mmc/host/sdhci-of-arasan.c static int sdhci_arasan_probe(struct platform_device *pdev) · line 179
Quoted 8 lines
drivers/mmc/host/sdhci-of-arasan.c +2
-1@@ -172,7 +173,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) ret =sdhci_add_host (host);if (ret) { -dev_err (&pdev->dev,"platform register failed (%d)\n" , ret); +if (ret != -EPROBE_DEFER ) +dev_err (&pdev->dev,"platform register failed (%d)\n" , ret); goto err_pltfm_free; }I checked other drivers and they are not reporting these bugs. I have briefly looked at
sdhci_add_hostandsdhci_platfm_initand they are pretty good error description
+ core itself should report if driver probe failed.
That's why I think that it is just reasonable to remove these bothdev_errcompletely.
Quoted 1 line
What do you think?
I agree, this seems reasonable!
Kind regards
Uffe
Re: [PATCH 2/2] mmc/host/sdhci-of-arasan.c: Skip EPROBE_DEFER error messages
As discussed here, I'll post a new patch which simply removes the error messages.
PATCH 1/1 mmc/host/sdhci-of-arasan.c: Omit superfluous error messages
sdhci_add_host and sdhci_platfm_init already report failure, so don't emit error messages when a failure occurs. This prevents occurences of "deferred" messages when required power supplies are not ready for operation yet.
--- drivers/mmc/host/sdhci-of-arasan.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mmc/host/sdhci-of-arasan.c +1 -4
@@ -161,7 +161,6 @@ static int sdhci_arasan_probe(struct platform_device *pdev) host =sdhci_pltfm_init (pdev, &sdhci_arasan_pdata,0 );if (IS_ERR (host)) { ret =PTR_ERR (host); -dev_err (&pdev->dev,"platform init failed (%d)\n" , ret); goto clk_disable_all; }
@@ -171,10 +170,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) pltfm_host->clk = clk_xin; ret =sdhci_add_host (host); -if (ret) { -dev_err (&pdev->dev,"platform register failed (%d)\n" , ret); +if (ret) goto err_pltfm_free; - }return 0 ;
Signature · 1 line
1.7.9.5
Ulf Hansson
AppliedRe: [PATCH] mmc/host/sdhci-of-arasan.c: Omit superfluous error messages
Quoted 6 lines · Mike Looijmans
sdhci_add_hostandsdhci_platfm_initalready report failure, so don't emit error messages when a failure occurs. This prevents occurences of "deferred" messages when required power supplies are not ready for operation yet.Signed-off-by Mike Looijmans <[email protected]>
Thanks! Applied for next.
Kind regards
Uffe
Quoted 31 lines
--- drivers/mmc/host/sdhci-of-arasan.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/mmc/host/sdhci-of-arasan.c +1
-5@@ -161,7 +161,6 @@ static int sdhci_arasan_probe(struct platform_device *pdev) host =sdhci_pltfm_init (pdev, &sdhci_arasan_pdata,0 );if (IS_ERR (host)) { ret =PTR_ERR (host); -dev_err (&pdev->dev,"platform init failed (%d)\n" , ret); goto clk_disable_all; }@@ -171,10 +170,8 @@ static int sdhci_arasan_probe(struct platform_device *pdev) pltfm_host->clk = clk_xin; ret =sdhci_add_host (host); -if (ret) { -dev_err (&pdev->dev,"platform register failed (%d)\n" , ret); +if (ret) goto err_pltfm_free; - }return 0 ; --1.7.9.5
Ulf Hansson
AppliedQuoted 6 lines · Mike Looijmans
"ret" is a signed int, so use "%d" in format strings instead of "%u". This prevents cryptic codes in error messages like this:
sdhci-arasan e0101000.sdhci: platform register failed (4294966779)Signed-off-by Mike Looijmans <[email protected]>Reviewed-by Michal Simek <[email protected]>
Thanks! Applied for next.
I will expect a v2 of patch2.
Kind regards
Uffe
Quoted 29 lines
--- drivers/mmc/host/sdhci-of-arasan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mmc/host/sdhci-of-arasan.c +2
-3@@ -161,7 +161,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev) host =sdhci_pltfm_init (pdev, &sdhci_arasan_pdata,0 );if (IS_ERR (host)) { ret =PTR_ERR (host); -dev_err (&pdev->dev,"platform init failed (%u)\n" , ret); +dev_err (&pdev->dev,"platform init failed (%d)\n" , ret); goto clk_disable_all; }@@ -172,7 +172,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev) ret =sdhci_add_host (host);if (ret) { -dev_err (&pdev->dev,"platform register failed (%u)\n" , ret); +dev_err (&pdev->dev,"platform register failed (%d)\n" , ret); goto err_pltfm_free; } --1.7.9.5