* [PATCH] mmc: mxcmmc: fix error return code in mxcmci_probe()
@ 2017-07-07 5:59 Gustavo A. R. Silva
2017-07-11 14:43 ` Ulf Hansson
0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2017-07-07 5:59 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-mmc, linux-kernel, Gustavo A. R. Silva
platform_get_irq() returns an error code, but the mxcmmc driver
ignores it and always returns -EINVAL. This is not correct,
and prevents -EPROBE_DEFER from being propagated properly.
Print error message and propagate the return value of
platform_get_irq on failure.
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
drivers/mmc/host/mxcmmc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index fb3ca82..f3c2832 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -1014,8 +1014,10 @@ static int mxcmci_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0);
- if (irq < 0)
- return -EINVAL;
+ if (irq < 0) {
+ dev_err(&pdev->dev, "failed to get IRQ: %d\n", irq);
+ return irq;
+ }
mmc = mmc_alloc_host(sizeof(*host), &pdev->dev);
if (!mmc)
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: mxcmmc: fix error return code in mxcmci_probe()
2017-07-07 5:59 [PATCH] mmc: mxcmmc: fix error return code in mxcmci_probe() Gustavo A. R. Silva
@ 2017-07-11 14:43 ` Ulf Hansson
2017-07-17 4:53 ` Gustavo A. R. Silva
0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2017-07-11 14:43 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
On 7 July 2017 at 07:59, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
> platform_get_irq() returns an error code, but the mxcmmc driver
> ignores it and always returns -EINVAL. This is not correct,
> and prevents -EPROBE_DEFER from being propagated properly.
>
> Print error message and propagate the return value of
> platform_get_irq on failure.
>
> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Thanks, applied for next!
Kind regards
Uffe
> ---
> drivers/mmc/host/mxcmmc.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
> index fb3ca82..f3c2832 100644
> --- a/drivers/mmc/host/mxcmmc.c
> +++ b/drivers/mmc/host/mxcmmc.c
> @@ -1014,8 +1014,10 @@ static int mxcmci_probe(struct platform_device *pdev)
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> irq = platform_get_irq(pdev, 0);
> - if (irq < 0)
> - return -EINVAL;
> + if (irq < 0) {
> + dev_err(&pdev->dev, "failed to get IRQ: %d\n", irq);
> + return irq;
> + }
>
> mmc = mmc_alloc_host(sizeof(*host), &pdev->dev);
> if (!mmc)
> --
> 2.5.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: mxcmmc: fix error return code in mxcmci_probe()
2017-07-11 14:43 ` Ulf Hansson
@ 2017-07-17 4:53 ` Gustavo A. R. Silva
0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2017-07-17 4:53 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Hi Ulf,
On 07/11/2017 09:43 AM, Ulf Hansson wrote:
> On 7 July 2017 at 07:59, Gustavo A. R. Silva <garsilva@embeddedor.com> wrote:
>> platform_get_irq() returns an error code, but the mxcmmc driver
>> ignores it and always returns -EINVAL. This is not correct,
>> and prevents -EPROBE_DEFER from being propagated properly.
>>
>> Print error message and propagate the return value of
>> platform_get_irq on failure.
>>
>> Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
>
> Thanks, applied for next!
>
Thank you!
> Kind regards
> Uffe
>
>> ---
>> drivers/mmc/host/mxcmmc.c | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
>> index fb3ca82..f3c2832 100644
>> --- a/drivers/mmc/host/mxcmmc.c
>> +++ b/drivers/mmc/host/mxcmmc.c
>> @@ -1014,8 +1014,10 @@ static int mxcmci_probe(struct platform_device *pdev)
>>
>> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> irq = platform_get_irq(pdev, 0);
>> - if (irq < 0)
>> - return -EINVAL;
>> + if (irq < 0) {
>> + dev_err(&pdev->dev, "failed to get IRQ: %d\n", irq);
>> + return irq;
>> + }
>>
>> mmc = mmc_alloc_host(sizeof(*host), &pdev->dev);
>> if (!mmc)
>> --
>> 2.5.0
>>
--
Gustavo A. R. Silva
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-17 4:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-07 5:59 [PATCH] mmc: mxcmmc: fix error return code in mxcmci_probe() Gustavo A. R. Silva
2017-07-11 14:43 ` Ulf Hansson
2017-07-17 4:53 ` Gustavo A. R. Silva
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.