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: 7174001 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BABE8BEEC1 for ; Mon, 14 Sep 2015 08:58:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA1F92053A for ; Mon, 14 Sep 2015 08:58:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F3EC4204D1 for ; Mon, 14 Sep 2015 08:58:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751938AbbINI6O (ORCPT ); Mon, 14 Sep 2015 04:58:14 -0400 Received: from mail-la0-f50.google.com ([209.85.215.50]:35877 "EHLO mail-la0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754502AbbINI4o (ORCPT ); Mon, 14 Sep 2015 04:56:44 -0400 Received: by lanb10 with SMTP id b10so81985839lan.3 for ; Mon, 14 Sep 2015 01:56:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GTeuAZEBafrdlEb7U6SL4zVr7JGFPVUf8CQDbI7HN54=; b=lggkcwPTL/mJLFLbAg9/2T+/XiMTd/m771pSO58lD7bYlorn5x1cq4HM2fMnrcyAXz 0Dy837b1kWizNz/bm2JUoBOYzJ0/7OScZzUin3klsC3X9M03GQ4pIo4l3n04PYsnQoGb JhX5jK9I5n73TuBDjQaReAEJR0ZHsypq01ryC6LkOpIwuQlAhO/d3t9yu64ZY24w2kVX w+eFWPgLUXuiLWnbN1vWNywajSx2I4OgKeFOLKQRQtnKGHIyrLQ+EyMN9yuSBka2iTno jnyu7791XTwdYporIZkI3Rod2dnzk1ljI0S8wR2yCPw9WLDhnWmXRoYJXY/fVmLRbTl6 ejBg== X-Gm-Message-State: ALoCoQm/6YAX/Ocedu5QPQy4SW/7sxvdgo22FnuXx9QXnlilnkPa1o90D1UdhmQEvur+JHxVd7pI 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 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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"))