From patchwork Mon Sep 14 08:56:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 53539 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 328E72056A for ; Mon, 14 Sep 2015 08:56:45 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf43148337lbb.3 for ; Mon, 14 Sep 2015 01:56:44 -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=GTeuAZEBafrdlEb7U6SL4zVr7JGFPVUf8CQDbI7HN54=; b=Y1QvmZ3z8M7FxTWKA6DBTE10y1/TA+aH/oY+KcvOd6vm+SQFJAozEKrw2U4Bgkmp2S w+SKsfSfUlhwB8mztl1vF269VPey2ZHK+qny9/L1ZOBXDDEqMtJPRxDR12cKGTk2SRKI h+y6jDAoYv35zUkphwZflBI3Veeb7drz5xytttfp/TcKUhR5Y0G4pLumPWTRglmLMRlp EXdNzON0/uCUKkhw+I0jJzZHVspoa5CHZw2JenrFEZN638+wqLTuTIVszTaPjJiWhZte GgrDGyvckvOhKyLegGIwBWqq1tooxGg2N+l6obNwDeFsBQwL6/kvtefif2uV3rlYTtNE FwiA== X-Gm-Message-State: ALoCoQnl1TioTo3lANEBoNHl0+cV6uUixkk5CiZ/GL3G3sbhVa6ABHUPNSeA4bOySrtxyfhkVyKr X-Received: by 10.112.149.39 with SMTP id tx7mr2791927lbb.11.1442221004119; Mon, 14 Sep 2015 01:56:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.134 with SMTP id f6ls597789lae.74.gmail; Mon, 14 Sep 2015 01:56:44 -0700 (PDT) X-Received: by 10.112.14.8 with SMTP id l8mr12559035lbc.68.1442221003974; Mon, 14 Sep 2015 01:56:43 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id jj4si9042048lbc.66.2015.09.14.01.56.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 01:56:43 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by lamp12 with SMTP id p12so81356056lam.0 for ; Mon, 14 Sep 2015 01:56:43 -0700 (PDT) X-Received: by 10.152.21.196 with SMTP id x4mr7030965lae.86.1442221003897; Mon, 14 Sep 2015 01:56:43 -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 w3csp1068637lbq; Mon, 14 Sep 2015 01:56:43 -0700 (PDT) X-Received: by 10.152.4.39 with SMTP id h7mr8128141lah.99.1442221003373; Mon, 14 Sep 2015 01:56:43 -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 jb6si9048745lbc.40.2015.09.14.01.56.43 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 01:56:43 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lahg1 with SMTP id g1so52371522lah.1 for ; Mon, 14 Sep 2015 01:56:43 -0700 (PDT) X-Received: by 10.112.171.69 with SMTP id as5mr12209958lbc.111.1442221002887; Mon, 14 Sep 2015 01:56:42 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by smtp.gmail.com with ESMTPSA id dd6sm2195605lad.44.2015.09.14.01.56.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Sep 2015 01:56:42 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Michal Simek Subject: [PATCH] mmc: core: Don't return an error for CD/WP GPIOs when GPIOLIB is unset Date: Mon, 14 Sep 2015 10:56:33 +0200 Message-Id: <1442220993-20468-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.44 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 --- 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..ad11425 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"))