diff mbox

mmc: sdhci-acpi: fix error return code in sdhci_acpi_add_own_cd()

Message ID CAPgLHd_FWg3egTZxBena+BTgWdZCzqr9AjV1_NpWBGYD3aPz0w@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun May 28, 2013, 5:26 a.m. UTC
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Fix to return a negative error code in the gpio_to_irq() error
handling case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/mmc/host/sdhci-acpi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jingoo Han May 28, 2013, 5:35 a.m. UTC | #1
On Tuesday, May 28, 2013 2:26 PM, Wei Yongjun wrote:
> 
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Fix to return a negative error code in the gpio_to_irq() error
> handling case instead of 0, as done elsewhere in this function.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

It looks good.

Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Best regards,
Jingoo Han

> ---
>  drivers/mmc/host/sdhci-acpi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index a51e603..08a85ec 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -189,8 +189,10 @@ static int sdhci_acpi_add_own_cd(struct device *dev, int gpio,
>  		goto out;
> 
>  	irq = gpio_to_irq(gpio);
> -	if (irq < 0)
> +	if (irq < 0) {
> +		err = irq;
>  		goto out_free;
> +	}
> 
>  	flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
>  	err = devm_request_irq(dev, irq, sdhci_acpi_sd_cd, flags, "sd_cd", mmc);

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Adrian Hunter May 28, 2013, 6:27 a.m. UTC | #2
On 28/05/13 08:35, Jingoo Han wrote:
> On Tuesday, May 28, 2013 2:26 PM, Wei Yongjun wrote:
>>
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> Fix to return a negative error code in the gpio_to_irq() error
>> handling case instead of 0, as done elsewhere in this function.
>>
>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> It looks good.
> 
> Reviewed-by: Jingoo Han <jg1.han@samsung.com>

Yes, thank you!

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> 
> Best regards,
> Jingoo Han
> 
>> ---
>>  drivers/mmc/host/sdhci-acpi.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
>> index a51e603..08a85ec 100644
>> --- a/drivers/mmc/host/sdhci-acpi.c
>> +++ b/drivers/mmc/host/sdhci-acpi.c
>> @@ -189,8 +189,10 @@ static int sdhci_acpi_add_own_cd(struct device *dev, int gpio,
>>  		goto out;
>>
>>  	irq = gpio_to_irq(gpio);
>> -	if (irq < 0)
>> +	if (irq < 0) {
>> +		err = irq;
>>  		goto out_free;
>> +	}
>>
>>  	flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
>>  	err = devm_request_irq(dev, irq, sdhci_acpi_sd_cd, flags, "sd_cd", mmc);
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Adrian Hunter June 10, 2013, 6:35 a.m. UTC | #3
Hi Chris

Please add this to mmc-next.

Regards
Adrian

On 28/05/13 09:27, Adrian Hunter wrote:
> On 28/05/13 08:35, Jingoo Han wrote:
>> On Tuesday, May 28, 2013 2:26 PM, Wei Yongjun wrote:
>>>
>>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>>
>>> Fix to return a negative error code in the gpio_to_irq() error
>>> handling case instead of 0, as done elsewhere in this function.
>>>
>>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> It looks good.
>>
>> Reviewed-by: Jingoo Han <jg1.han@samsung.com>
> 
> Yes, thank you!
> 
> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> 
>>
>> Best regards,
>> Jingoo Han
>>
>>> ---
>>>  drivers/mmc/host/sdhci-acpi.c | 4 +++-
>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
>>> index a51e603..08a85ec 100644
>>> --- a/drivers/mmc/host/sdhci-acpi.c
>>> +++ b/drivers/mmc/host/sdhci-acpi.c
>>> @@ -189,8 +189,10 @@ static int sdhci_acpi_add_own_cd(struct device *dev, int gpio,
>>>  		goto out;
>>>
>>>  	irq = gpio_to_irq(gpio);
>>> -	if (irq < 0)
>>> +	if (irq < 0) {
>>> +		err = irq;
>>>  		goto out_free;
>>> +	}
>>>
>>>  	flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
>>>  	err = devm_request_irq(dev, irq, sdhci_acpi_sd_cd, flags, "sd_cd", mmc);
>>
>>
>>
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Chris Ball June 27, 2013, 2:56 p.m. UTC | #4
Hi,

On Tue, May 28 2013, Adrian Hunter wrote:
> On 28/05/13 08:35, Jingoo Han wrote:
>> On Tuesday, May 28, 2013 2:26 PM, Wei Yongjun wrote:
>>>
>>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>>
>>> Fix to return a negative error code in the gpio_to_irq() error
>>> handling case instead of 0, as done elsewhere in this function.
>>>
>>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>> 
>> It looks good.
>> 
>> Reviewed-by: Jingoo Han <jg1.han@samsung.com>
>
> Yes, thank you!
>
> Acked-by: Adrian Hunter <adrian.hunter@intel.com>

Pushed to mmc-next for 3.11, sorry for the delay.

- Chris.
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index a51e603..08a85ec 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -189,8 +189,10 @@  static int sdhci_acpi_add_own_cd(struct device *dev, int gpio,
 		goto out;
 
 	irq = gpio_to_irq(gpio);
-	if (irq < 0)
+	if (irq < 0) {
+		err = irq;
 		goto out_free;
+	}
 
 	flags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
 	err = devm_request_irq(dev, irq, sdhci_acpi_sd_cd, flags, "sd_cd", mmc);