From patchwork Fri Sep 18 09:43:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Qilong X-Patchwork-Id: 1366731 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4Bt7yp3T3gz9sTH for ; Fri, 18 Sep 2020 19:37:06 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726126AbgIRJhE (ORCPT ); Fri, 18 Sep 2020 05:37:04 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13258 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726109AbgIRJhE (ORCPT ); Fri, 18 Sep 2020 05:37:04 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id EE6456E85A48B8230523; Fri, 18 Sep 2020 17:36:58 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Fri, 18 Sep 2020 17:36:56 +0800 From: Qilong Zhang To: , CC: Subject: [PATCH -next] ata: pata_octeon_cf: indicate correct error reason in octeon_cf_probe Date: Fri, 18 Sep 2020 17:43:48 +0800 Message-ID: <20200918094348.110476-1-zhangqilong3@huawei.com> X-Mailer: git-send-email 2.26.0.106.g9fadedd MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Zhang Qilong 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 --- 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;