Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp346219pxu; Wed, 25 Nov 2020 04:55:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhIDPQf1k2vCyyoYlVHM1qCYuJ6rGjVx+pubav1LKIvNERXQx8atA91NY+dI6CeRPaFKCy X-Received: by 2002:a17:906:e4f:: with SMTP id q15mr3016259eji.220.1606308912727; Wed, 25 Nov 2020 04:55:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606308912; cv=none; d=google.com; s=arc-20160816; b=zjFBlVKiVzDeBEcS3slQBgrs/H0jXF7MvaPcjlpTp9Bm4wcZqC6sicviQoL+MEdYPu dVU3ngyJRt3YqKVZ1sHWdR9hjLRQEo/FNquF0cVqBXAYOsZb34QzBjmrTIEBYWHE2hbw T+VsJjDplY8Z4AOAOLh+rt6YSuDzP3Ip5F07yw403tUKYSQ95Sy4Q5mH4eEobgB1kJai NPo8CEZIyUL+ugaBCBYvPicT98t9Nc8fGZ5YULsjZtr1cDL6fc7H/OBEStoMQF6Ex1ZE l6TF8B5w11EGJMbewfdxtZ400IUbY5PDEbXBE7FZYmUfnNBWeeik9W6xLVUGnNQZ1FSz Jc4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=DOL660moqHdjNQa6M7NKCCqFJhtfH8IpsK8nYl9oUIM=; b=YTPQOFls4OWHDAwCtOKHRm+Q83JIe3KetifcqbiqSMaynP4HjzV8iW8aYn7vj8F7NB SVT9VK1COGCwL1rWsC46CcvppgOR6XAUz1oDtVQOW0bMxyqPxipA2hxKDIkWQlNPEOZb I2PR2ln1ZJiE87UmDhUKcXaYXDxJrTfIZyCEecQLXBz7t4Ud2faEUxSTYm87k8YXICwE t0hE3I6oop5xu88heOqTp7bCMvjs7EmMHw3ZJbvjDSxzmQyOMot5gmTzpinDaVwtLtnJ xsyorG9wjo/vm853yDClOo6fYPqTQ8bUcIS+Ce/K9HMREjAkxt6LiBu5hpHiucFz7rdX 0Whg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bx13si1153461edb.284.2020.11.25.04.54.49; Wed, 25 Nov 2020 04:55:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726826AbgKYMvO (ORCPT + 99 others); Wed, 25 Nov 2020 07:51:14 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8034 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725616AbgKYMvN (ORCPT ); Wed, 25 Nov 2020 07:51:13 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Ch12v4z9lzhZdw; Wed, 25 Nov 2020 20:50:47 +0800 (CST) Received: from huawei.com (10.175.124.27) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Wed, 25 Nov 2020 20:51:01 +0800 From: Wang ShaoBo To: CC: , , , , Subject: [PATCH] pcmcia: omap: Fix error return code in omap_cf_probe() Date: Wed, 25 Nov 2020 20:50:57 +0800 Message-ID: <20201125125057.30669-1-bobo.shaobowang@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix to return proper error code instaed of 0 in omap_cf_probe(), as done elsewhere in this function. Signed-off-by: Wang ShaoBo --- drivers/pcmcia/omap_cf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index d3ef5534991e..f0b2c2d03469 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c @@ -252,11 +252,15 @@ static int __init omap_cf_probe(struct platform_device *pdev) /* pcmcia layer only remaps "real" memory */ cf->socket.io_offset = (unsigned long) ioremap(cf->phys_cf + SZ_4K, SZ_2K); - if (!cf->socket.io_offset) + if (!cf->socket.io_offset) { + status = -ENOMEM; goto fail1; + } - if (!request_mem_region(cf->phys_cf, SZ_8K, driver_name)) + if (!request_mem_region(cf->phys_cf, SZ_8K, driver_name)) { + status = -ENXIO; goto fail1; + } /* NOTE: CF conflicts with MMC1 */ omap_cfg_reg(W11_1610_CF_CD1); -- 2.17.1