From patchwork Mon Sep 14 10:18:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 53541 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id C65632056A for ; Mon, 14 Sep 2015 10:19:07 +0000 (UTC) Received: by wicuu12 with SMTP id uu12sf39486071wic.2 for ; Mon, 14 Sep 2015 03:19:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=4PCWbjfWJBrO6Jg8FUOy+hFBEts5fiCmoVwFYn7AcEY=; b=kTfP8/cXIuKG0urmzBM5oskHOHIyLwWwTAOp0fACkW8aohlRJTNVgdH0EAO17+vAJL l7OIVcOUKrzMtJV/GMzSLnnBiQbhXniUPR6TEfW0i/UM9RDxFsmiJBd/juOF8m+4An2p /Bp4KpY2WA9+SaUE1Di9OwAGllBZ6wuvCHZxuuEcUpmWGaogM9/+FOMUftl3YU7MSo7H n3mK7pLViIdjAxp0W7ZVh7o5r5YrsI6FFTzO7o9OASmkiDeuRi8/oVmmOlBartrzchRE nyqK/jKDf4raubGvtwJMS9Yl3eDaxWBaz+av0woDIKmsik4vKdMnWTbDgUEYtzKxhxNg eTrg== X-Gm-Message-State: ALoCoQlDSl+JLWHrT/NYHXIdAv73Gq498jz5tvFyg7LJVuBTo2rcCmmlQ9gzCfu6ZijJwT6XdVLZ X-Received: by 10.180.81.165 with SMTP id b5mr2723935wiy.1.1442225947135; Mon, 14 Sep 2015 03:19:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.166 with SMTP id n6ls543072laf.86.gmail; Mon, 14 Sep 2015 03:19:06 -0700 (PDT) X-Received: by 10.152.21.196 with SMTP id x4mr7382850lae.86.1442225946839; Mon, 14 Sep 2015 03:19:06 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id t1si9208663lae.137.2015.09.14.03.19.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 03:19:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lagj9 with SMTP id j9so84589827lag.2 for ; Mon, 14 Sep 2015 03:19:06 -0700 (PDT) X-Received: by 10.152.26.98 with SMTP id k2mr12505738lag.41.1442225946758; Mon, 14 Sep 2015 03:19:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1108431lbq; Mon, 14 Sep 2015 03:19:06 -0700 (PDT) X-Received: by 10.152.10.71 with SMTP id g7mr12797653lab.61.1442225946269; Mon, 14 Sep 2015 03:19:06 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id h3si9224853lah.51.2015.09.14.03.19.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 03:19:06 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbcao8 with SMTP id ao8so64611093lbc.3 for ; Mon, 14 Sep 2015 03:19:06 -0700 (PDT) X-Received: by 10.112.154.106 with SMTP id vn10mr12771072lbb.38.1442225946107; Mon, 14 Sep 2015 03:19:06 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by smtp.gmail.com with ESMTPSA id n6sm2251665lbj.11.2015.09.14.03.19.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Sep 2015 03:19:05 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Michal Simek , Marcus Overhagen , Venu Byravarasu Subject: [PATCH V2] mmc: core: Don't return an error for CD/WP GPIOs when GPIOLIB is unset Date: Mon, 14 Sep 2015 12:18:55 +0200 Message-Id: <1442225935-24155-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , When CONFIG_GPIOLIB is unset, its stubs will return -ENOSYS. That means when the mmc core parses DT for CD/WP GPIOs via mmc_of_parse(), -ENOSYS becomes propagated to the caller. Typically this means that the mmc host driver fails to probe. As the CD/WP GPIOs are already treated as optional, let's extend that to cover the case when CONFIG_GPIOLIB is unset. Reported-by: Michal Simek Fixes: 16b23787fc70 ("mmc: sdhci-of-arasan: Call OF parsing for MMC") Signed-off-by: Ulf Hansson Tested-by: Michal Simek ACKed-by: Venu Byravarasu --- Changes in v2: - Corrected error code check. --- drivers/mmc/core/host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index abd933b..5466f25 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -457,7 +457,7 @@ int mmc_of_parse(struct mmc_host *host) 0, &cd_gpio_invert); if (!ret) dev_info(host->parent, "Got CD GPIO\n"); - else if (ret != -ENOENT) + else if (ret != -ENOENT && ret != -ENOSYS) return ret; /* @@ -481,7 +481,7 @@ int mmc_of_parse(struct mmc_host *host) ret = mmc_gpiod_request_ro(host, "wp", 0, false, 0, &ro_gpio_invert); if (!ret) dev_info(host->parent, "Got WP GPIO\n"); - else if (ret != -ENOENT) + else if (ret != -ENOENT && ret != -ENOSYS) return ret; if (of_property_read_bool(np, "disable-wp"))