* [PATCH -next] staging: xillybus: fix error return code in xilly_probe()
@ 2013-12-16 5:51 Wei Yongjun
2013-12-16 10:06 ` Jingoo Han
0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2013-12-16 5:51 UTC (permalink / raw)
To: gregkh, eli.billauer, jg1.han; +Cc: yongjun_wei, devel, linux-kernel
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Fix to return negative error code -EIO from the error handling
case instead of 0.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/staging/xillybus/xillybus_pcie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/xillybus/xillybus_pcie.c b/drivers/staging/xillybus/xillybus_pcie.c
index 0564f97..51426d8 100644
--- a/drivers/staging/xillybus/xillybus_pcie.c
+++ b/drivers/staging/xillybus/xillybus_pcie.c
@@ -168,9 +168,9 @@ static int xilly_probe(struct pci_dev *pdev,
}
endpoint->registers = pci_iomap(pdev, 0, 128);
-
if (!endpoint->registers) {
dev_err(endpoint->dev, "Failed to map BAR 0. Aborting.\n");
+ rc = -EIO;
goto failed_iomap0;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] staging: xillybus: fix error return code in xilly_probe()
2013-12-16 5:51 [PATCH -next] staging: xillybus: fix error return code in xilly_probe() Wei Yongjun
@ 2013-12-16 10:06 ` Jingoo Han
2013-12-16 12:47 ` Eli Billauer
0 siblings, 1 reply; 3+ messages in thread
From: Jingoo Han @ 2013-12-16 10:06 UTC (permalink / raw)
To: 'Wei Yongjun', gregkh, eli.billauer
Cc: yongjun_wei, devel, linux-kernel, 'Jingoo Han'
On Monday, December 16, 2013 2:51 PM, Wei Yongjun wrote:
>
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fix to return negative error code -EIO from the error handling
> case instead of 0.
>
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
> drivers/staging/xillybus/xillybus_pcie.c | 2 +-
It looks good.
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Best regards,
Jingoo Han
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/xillybus/xillybus_pcie.c b/drivers/staging/xillybus/xillybus_pcie.c
> index 0564f97..51426d8 100644
> --- a/drivers/staging/xillybus/xillybus_pcie.c
> +++ b/drivers/staging/xillybus/xillybus_pcie.c
> @@ -168,9 +168,9 @@ static int xilly_probe(struct pci_dev *pdev,
> }
>
> endpoint->registers = pci_iomap(pdev, 0, 128);
> -
> if (!endpoint->registers) {
> dev_err(endpoint->dev, "Failed to map BAR 0. Aborting.\n");
> + rc = -EIO;
> goto failed_iomap0;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] staging: xillybus: fix error return code in xilly_probe()
2013-12-16 10:06 ` Jingoo Han
@ 2013-12-16 12:47 ` Eli Billauer
0 siblings, 0 replies; 3+ messages in thread
From: Eli Billauer @ 2013-12-16 12:47 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Wei Yongjun', gregkh, yongjun_wei, devel, linux-kernel
Thanks for reporting this bug. The same bug exists in the driver for OF
(xillybus_of.c).
As for the choice of -EIO, I've surveyed several drivers calling
of_iomap() and pci_iomap(), and it turns out that some fail on -ENOMEM,
some on -EIO and some on -EBUSY.
Personally, I'm inclined towards -ENOMEM, since the problem is a memory
mapping failure.
I'll submit a patch fixing both files soon.
Thanks again,
Eli
On 16/12/13 12:06, Jingoo Han wrote:
> On Monday, December 16, 2013 2:51 PM, Wei Yongjun wrote:
>
>> From: Wei Yongjun<yongjun_wei@trendmicro.com.cn>
>>
>> Fix to return negative error code -EIO from the error handling
>> case instead of 0.
>>
>> Signed-off-by: Wei Yongjun<yongjun_wei@trendmicro.com.cn>
>> ---
>> drivers/staging/xillybus/xillybus_pcie.c | 2 +-
>>
> It looks good.
> Reviewed-by: Jingoo Han<jg1.han@samsung.com>
>
> Best regards,
> Jingoo Han
>
>
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/xillybus/xillybus_pcie.c b/drivers/staging/xillybus/xillybus_pcie.c
>> index 0564f97..51426d8 100644
>> --- a/drivers/staging/xillybus/xillybus_pcie.c
>> +++ b/drivers/staging/xillybus/xillybus_pcie.c
>> @@ -168,9 +168,9 @@ static int xilly_probe(struct pci_dev *pdev,
>> }
>>
>> endpoint->registers = pci_iomap(pdev, 0, 128);
>> -
>> if (!endpoint->registers) {
>> dev_err(endpoint->dev, "Failed to map BAR 0. Aborting.\n");
>> + rc = -EIO;
>> goto failed_iomap0;
>> }
>>
>>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-12-16 13:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-16 5:51 [PATCH -next] staging: xillybus: fix error return code in xilly_probe() Wei Yongjun
2013-12-16 10:06 ` Jingoo Han
2013-12-16 12:47 ` Eli Billauer
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.