diff mbox series

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

Message ID 20200918094348.110476-1-zhangqilong3@huawei.com
State Not Applicable
Delegated to: David Miller
Headers show
Series [-next] ata: pata_octeon_cf: indicate correct error reason in octeon_cf_probe | expand

Commit Message

Zhang Qilong Sept. 18, 2020, 9:43 a.m. UTC
From: Zhang Qilong <zhangqilong3@huawei.com>

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@huawei.com>
---
 drivers/ata/pata_octeon_cf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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;