From patchwork Tue Mar 3 12:28:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 5921951 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 714EF9F36A for ; Tue, 3 Mar 2015 12:28:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E497202B8 for ; Tue, 3 Mar 2015 12:28:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 92456201CE for ; Tue, 3 Mar 2015 12:28:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755249AbbCCM2p (ORCPT ); Tue, 3 Mar 2015 07:28:45 -0500 Received: from mail-we0-f172.google.com ([74.125.82.172]:34948 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755159AbbCCM2o (ORCPT ); Tue, 3 Mar 2015 07:28:44 -0500 Received: by wevl61 with SMTP id l61so39538585wev.2; Tue, 03 Mar 2015 04:28:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7kMfVHJEJbORzQg/HKlA/vp/AG5jpd+4mWYh7XqXGP4=; b=lChU3P/U6Zn6rEcIMQAAoJXhjnwTZcZGARz4efR5mvGOEqhdK9pZlGFfQDNHNU1Hs8 EGMIgvlxx8pSfPVjugXaz+akxw46rKWXxcY2BHzX3ezzR83NiQo0oAI+fRAbJJY5SXPq rWffgDm37/ki/+Ee5+ngQt7FuUhC3Fc8oht53v+LfGGfNJy0eANcKxqcdA/7A13aeqvk Frz5mWosj5kPpw9a1aJPPhNe3JVAYSpMzbdQeVN1YEx6yZwUeagPFi7TtS8H2NJr3hAj 76EGFBXL4JUA6HakuJSRhKLF6LDHXW4dYnMV76ieHkYMmgPVShK7xYEeIiMHE8HGg/y8 yhCQ== X-Received: by 10.194.157.68 with SMTP id wk4mr69536373wjb.123.1425385723660; Tue, 03 Mar 2015 04:28:43 -0800 (PST) Received: from localhost (ip-94-112-1-170.net.upcbroadband.cz. [94.112.1.170]) by mx.google.com with ESMTPSA id t9sm20361829wia.15.2015.03.03.04.28.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 04:28:42 -0800 (PST) From: Andreas Fenkart To: linux-mmc@vger.kernel.org Cc: linux-omap@vger.kernel.org, NeilBrown , Tony Lindgren , Ulf Hansson , Andreas Fenkart Subject: [PATCH 2/6] mmc: omap_hsmmc: use slot-gpio functions to manage read-only pin directly Date: Tue, 3 Mar 2015 13:28:14 +0100 Message-Id: <1425385698-6588-3-git-send-email-afenkart@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1425385698-6588-1-git-send-email-afenkart@gmail.com> References: <1425385698-6588-1-git-send-email-afenkart@gmail.com> 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 The indirection via omap_hsmmc_get_ro and omap_hsmmc_get_wp is redundant. Also dropped setting gpio_wp to EINVAL since platform date is read-only Untested: no device with ro pin was available, but change is fairly simple Signed-off-by: Andreas Fenkart --- drivers/mmc/host/omap_hsmmc.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 2276d58..77ad471 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -234,8 +234,6 @@ struct omap_hsmmc_host { int card_detect_irq; int (*card_detect)(struct device *dev); - int (*get_ro)(struct device *dev); - }; struct omap_mmc_of_data { @@ -252,13 +250,6 @@ static int omap_hsmmc_card_detect(struct device *dev) return mmc_gpio_get_cd(host->mmc); } -static int omap_hsmmc_get_wp(struct device *dev) -{ - struct omap_hsmmc_host *host = dev_get_drvdata(dev); - - return mmc_gpio_get_ro(host->mmc); -} - static int omap_hsmmc_get_cover_state(struct device *dev) { struct omap_hsmmc_host *host = dev_get_drvdata(dev); @@ -455,12 +446,9 @@ static int omap_hsmmc_gpio_init(struct mmc_host *mmc, } if (gpio_is_valid(pdata->gpio_wp)) { - host->get_ro = omap_hsmmc_get_wp; ret = mmc_gpio_request_ro(mmc, pdata->gpio_wp); if (ret) return ret; - } else { - pdata->gpio_wp = -EINVAL; } return 0; @@ -1637,15 +1625,6 @@ static int omap_hsmmc_get_cd(struct mmc_host *mmc) return host->card_detect(host->dev); } -static int omap_hsmmc_get_ro(struct mmc_host *mmc) -{ - struct omap_hsmmc_host *host = mmc_priv(mmc); - - if (!host->get_ro) - return -ENOSYS; - return host->get_ro(host->dev); -} - static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card) { struct omap_hsmmc_host *host = mmc_priv(mmc); @@ -1811,7 +1790,7 @@ static struct mmc_host_ops omap_hsmmc_ops = { .request = omap_hsmmc_request, .set_ios = omap_hsmmc_set_ios, .get_cd = omap_hsmmc_get_cd, - .get_ro = omap_hsmmc_get_ro, + .get_ro = mmc_gpio_get_ro, .init_card = omap_hsmmc_init_card, .enable_sdio_irq = omap_hsmmc_enable_sdio_irq, };