From patchwork Thu Mar 5 15:33:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 45466 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 ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B51E21494 for ; Thu, 5 Mar 2015 15:33:18 +0000 (UTC) Received: by wivr20 with SMTP id r20sf5080359wiv.0 for ; Thu, 05 Mar 2015 07:33:17 -0800 (PST) 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=2LXYQzHZ1f3KK/PnZxhk7a5Oj6FZljMQoioNPPgO8IE=; b=G3cs56A+OyXS4C71KnO9XoPKQ7u/GYLT26n34r/QuQWA3ew0OhDFf7s+nC9sj7hiEq qYwElXOByaSqLnvr9dk3hpi74Ehf3r3WptWcOvKPkURDmf5PNgPDzjNcV69BCJcdil71 hneJHvcUsHeOCzZK8ZcThUG99uBiLJWRHuFJNNxFqlCOOX0sZoxJwSoHoiiyUbVgvk+J q23tIXxJgm13H4awYWfgSltz9uWllLmAtELZTg9tysuxm/iTewXas03hIEtC7md3xJh9 kpHritMI9v490vXLdcJhFf14dU1PC3wT7JdEFQciOhz5kyCWDP2EMKVzKvZrGs3DSVys O20g== X-Gm-Message-State: ALoCoQkNSNg4qPZEZ5I5/yMQnFHp4nejqe9CJJXta+H3OCc+OvC1yiA46fdYAOQ1pNHxdTA5P6AD X-Received: by 10.194.221.65 with SMTP id qc1mr1612982wjc.7.1425569597671; Thu, 05 Mar 2015 07:33:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.5 with SMTP id ca5ls310329lad.96.gmail; Thu, 05 Mar 2015 07:33:17 -0800 (PST) X-Received: by 10.152.182.196 with SMTP id eg4mr8561228lac.70.1425569597512; Thu, 05 Mar 2015 07:33:17 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id z9si4716907lby.151.2015.03.05.07.33.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 07:33:17 -0800 (PST) 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 labhs14 with SMTP id hs14so52168036lab.1 for ; Thu, 05 Mar 2015 07:33:17 -0800 (PST) X-Received: by 10.152.116.18 with SMTP id js18mr8622945lab.106.1425569597419; Thu, 05 Mar 2015 07:33:17 -0800 (PST) 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.35.133 with SMTP id h5csp558518lbj; Thu, 5 Mar 2015 07:33:17 -0800 (PST) X-Received: by 10.152.88.71 with SMTP id be7mr8256693lab.119.1425569597018; Thu, 05 Mar 2015 07:33:17 -0800 (PST) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id j9si2902680lbc.32.2015.03.05.07.33.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 07:33:16 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbdu14 with SMTP id u14so30958724lbd.0 for ; Thu, 05 Mar 2015 07:33:16 -0800 (PST) X-Received: by 10.152.204.6 with SMTP id ku6mr8666326lac.62.1425569596727; Thu, 05 Mar 2015 07:33:16 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id xl2sm1331334lbb.6.2015.03.05.07.33.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Mar 2015 07:33:14 -0800 (PST) From: Ulf Hansson To: Ulf Hansson , Chris Ball , Viresh Kumar Cc: linux-mmc@vger.kernel.org, spear-devel@list.st.com Subject: [PATCH 2/2] mmc: sdhci-spear: Remove exported header Date: Thu, 5 Mar 2015 16:33:11 +0100 Message-Id: <1425569591-20387-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.45 as permitted sender) smtp.mail=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: , Move the member for card_int_gpio into the struct spear_sdhci. In this way we eliminate the last user of the struct sdhci_plat_data, which enables us to remove the exported header for sdhci-spear. Signed-off-by: Ulf Hansson --- drivers/mmc/host/sdhci-spear.c | 35 +++++++++-------------------------- include/linux/mmc/sdhci-spear.h | 34 ---------------------------------- 2 files changed, 9 insertions(+), 60 deletions(-) delete mode 100644 include/linux/mmc/sdhci-spear.h diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c index f482f7f..df08834 100644 --- a/drivers/mmc/host/sdhci-spear.c +++ b/drivers/mmc/host/sdhci-spear.c @@ -26,14 +26,13 @@ #include #include #include -#include #include #include #include "sdhci.h" struct spear_sdhci { struct clk *clk; - struct sdhci_plat_data *data; + int card_int_gpio; }; /* sdhci ops */ @@ -44,26 +43,16 @@ static const struct sdhci_ops sdhci_pltfm_ops = { .set_uhs_signaling = sdhci_set_uhs_signaling, }; -static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdev) +static void sdhci_probe_config_dt(struct device_node *np, + struct spear_sdhci *host) { - struct device_node *np = pdev->dev.of_node; - struct sdhci_plat_data *pdata = NULL; int cd_gpio; cd_gpio = of_get_named_gpio(np, "cd-gpios", 0); if (!gpio_is_valid(cd_gpio)) cd_gpio = -1; - /* If pdata is required */ - if (cd_gpio != -1) { - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) - dev_err(&pdev->dev, "DT: kzalloc failed\n"); - else - pdata->card_int_gpio = cd_gpio; - } - - return pdata; + host->card_int_gpio = cd_gpio; } static int sdhci_probe(struct platform_device *pdev) @@ -116,24 +105,18 @@ static int sdhci_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n", clk_get_rate(sdhci->clk)); - sdhci->data = sdhci_probe_config_dt(pdev); - if (IS_ERR(sdhci->data)) { - dev_err(&pdev->dev, "DT: Failed to get pdata\n"); - goto disable_clk; - } - + sdhci_probe_config_dt(pdev->dev.of_node, sdhci); /* * It is optional to use GPIOs for sdhci card detection. If - * sdhci->data is NULL, then use original sdhci lines otherwise + * sdhci->card_int_gpio < 0, then use original sdhci lines otherwise * GPIO lines. We use the built-in GPIO support for this. */ - if (sdhci->data && sdhci->data->card_int_gpio >= 0) { - ret = mmc_gpio_request_cd(host->mmc, - sdhci->data->card_int_gpio, 0); + if (sdhci->card_int_gpio >= 0) { + ret = mmc_gpio_request_cd(host->mmc, sdhci->card_int_gpio, 0); if (ret < 0) { dev_dbg(&pdev->dev, "failed to request card-detect gpio%d\n", - sdhci->data->card_int_gpio); + sdhci->card_int_gpio); goto disable_clk; } } diff --git a/include/linux/mmc/sdhci-spear.h b/include/linux/mmc/sdhci-spear.h deleted file mode 100644 index 8cc095a..0000000 --- a/include/linux/mmc/sdhci-spear.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * include/linux/mmc/sdhci-spear.h - * - * SDHCI declarations specific to ST SPEAr platform - * - * Copyright (C) 2010 ST Microelectronics - * Viresh Kumar - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#ifndef LINUX_MMC_SDHCI_SPEAR_H -#define LINUX_MMC_SDHCI_SPEAR_H - -#include -/* - * struct sdhci_plat_data: spear sdhci platform data structure - * - * card_int_gpio: gpio pin used for card detection - */ -struct sdhci_plat_data { - int card_int_gpio; -}; - -/* This function is used to set platform_data field of pdev->dev */ -static inline void -sdhci_set_plat_data(struct platform_device *pdev, struct sdhci_plat_data *data) -{ - pdev->dev.platform_data = data; -} - -#endif /* LINUX_MMC_SDHCI_SPEAR_H */