[PATCH -next] ata: pata_octeon_cf: indicate correct error reason in octeon_cf_probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Zhang Qilong <zhangqilong3@xxxxxxxxxx>

It maybe call devm_ioremap to map device IO address to memory. When
devm_ioremap operation failed, we should return '-ENOMEM' instead of
'-EINVAL' to alert callers in this case, callers may have different
operation later. Moreover, '-EINVAL' will be confused with the
previous error code when getting resource failed.

Signed-off-by: Zhang Qilong <zhangqilong3@xxxxxxxxxx>
---
 drivers/ata/pata_octeon_cf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c
index bd87476ab481..513998eaf15e 100644
--- a/drivers/ata/pata_octeon_cf.c
+++ b/drivers/ata/pata_octeon_cf.c
@@ -895,7 +895,7 @@ static int octeon_cf_probe(struct platform_device *pdev)
 									 resource_size(res_dma));
 				if (!cf_port->dma_base) {
 					of_node_put(dma_node);
-					return -EINVAL;
+					return -ENOMEM;
 				}
 
 				irq_handler = octeon_cf_interrupt;
-- 
2.17.1




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux