From patchwork Fri Mar 13 08:08:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 45752 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C6B48214BF for ; Fri, 13 Mar 2015 08:12:49 +0000 (UTC) Received: by lbdu14 with SMTP id u14sf15373593lbd.3 for ; Fri, 13 Mar 2015 01:12:48 -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:subject:date :message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=US+/kL53luDqarvoEFHXV4XplZtW4E2pPbFfVdAAXLo=; b=aiGfdT9EYLjJpj1nm7GhYR9JdxtO1KsUHDnJRQKovGJ1rkK+iQP3S6A2SF4z9K6sWP zjXFDGV39IkxGr8bRQgYf414wIGj+2C2uGobp/g+S7mtjs/L50vmMrGkKNijK0EcEpaU d1Di7yKyyeSVF41bIGEEwQaiOG2jpU8vRsAeqx7DTOQKNr8gtSROTXqXBJXtoisdT9vi B59NEV89WcZkTo6gedAPKELvyCITfT0kgGbR5TKjgUfcp1Hi8IdbXqPPQJnGtp2jCnyw P9y8ucqIa/cvvkMOAWEpH7xwI/b00/NnlYHQtmoArB3cFUzIcMReEUW0WdVUA69NtUXS Idiw== X-Gm-Message-State: ALoCoQn81sFG37nvPId2tgr2OzWdt6I6YJGop4MEsGjsLm4ELaOl00WdaZOiikO35He8px+K5sKi X-Received: by 10.180.90.169 with SMTP id bx9mr4225134wib.6.1426234368757; Fri, 13 Mar 2015 01:12:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.166 with SMTP id t6ls380153lat.83.gmail; Fri, 13 Mar 2015 01:12:48 -0700 (PDT) X-Received: by 10.152.5.170 with SMTP id t10mr42095257lat.43.1426234368531; Fri, 13 Mar 2015 01:12:48 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id sr5si844250lbb.113.2015.03.13.01.12.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Mar 2015 01:12:48 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by labge10 with SMTP id ge10so20515292lab.10 for ; Fri, 13 Mar 2015 01:12:48 -0700 (PDT) X-Received: by 10.152.116.11 with SMTP id js11mr20394656lab.106.1426234368396; Fri, 13 Mar 2015 01:12:48 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp742449lbj; Fri, 13 Mar 2015 01:12:47 -0700 (PDT) X-Received: by 10.70.26.129 with SMTP id l1mr98118164pdg.163.1426234366124; Fri, 13 Mar 2015 01:12:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ex7si2577273pdb.78.2015.03.13.01.12.44; Fri, 13 Mar 2015 01:12:46 -0700 (PDT) Received-SPF: none (google.com: linux-mmc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752862AbbCMIJm (ORCPT + 3 others); Fri, 13 Mar 2015 04:09:42 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:44920 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752946AbbCMIJR (ORCPT ); Fri, 13 Mar 2015 04:09:17 -0400 Received: by padet14 with SMTP id et14so27559024pad.11 for ; Fri, 13 Mar 2015 01:09:17 -0700 (PDT) X-Received: by 10.70.135.106 with SMTP id pr10mr98563284pdb.144.1426234157428; Fri, 13 Mar 2015 01:09:17 -0700 (PDT) Received: from localhost.localdomain ([107.6.112.156]) by mx.google.com with ESMTPSA id xh3sm2086850pab.25.2015.03.13.01.09.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Mar 2015 01:09:16 -0700 (PDT) From: Jun Nie To: linux-mmc@vger.kernel.org, ulf.hansson@linaro.org, chris@printf.net, shawn.guo@linaro.org, jun.nie@linaro.org Subject: [PATCH] mmc: core: do not abort if wp is disabled Date: Fri, 13 Mar 2015 16:08:53 +0800 Message-Id: <1426234133-5889-1-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: jun.nie@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.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Do not abort probe due to no detection to write protection pin, if host specify disable-wp. Signed-off-by: Jun Nie diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c index 8be0df7..30ed253 100644 --- a/drivers/mmc/core/host.c +++ b/drivers/mmc/core/host.c @@ -394,11 +394,14 @@ int mmc_of_parse(struct mmc_host *host) /* Parse Write Protection */ ro_cap_invert = of_property_read_bool(np, "wp-inverted"); - 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) - return ret; + if (!of_get_property(np, "disable-wp", NULL)) { + 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) + return ret; + } /* See the comment on CD inversion above */ if (ro_cap_invert ^ ro_gpio_invert)