From patchwork Thu Mar 5 15:33:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 45465 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3863A21494 for ; Thu, 5 Mar 2015 15:33:09 +0000 (UTC) Received: by lbiz11 with SMTP id z11sf19502505lbi.2 for ; Thu, 05 Mar 2015 07:33:08 -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=iZ/3o2PhSLx5G4jqKDayJd5WNAnncrNJXAHW2uSBI3A=; b=aypyV+pN4beMdTF/w2xuNsicKnMxs5PBmBI+pFxB1EnyxZwz7CtsjULjvjXv9rlYXv DR/VDLUmHGH+pcQURDzsejYmIlEUoK7kyPwOSmUjNLo6NsHoH0egTcyFyJ2rzFojRo3G T+/S1zTBhsPnYogJQLhdAoR2VLKmhHF5dbUBKK9D4oH+FCTyFsvAAQZ5YndbkAUmdNAA qJQfDc2q8lBbuy19QSv2/9Umjk+TSsZf5N6YU4M4mpge9xw/9YYci5bbKqwvaeFw5L2R NZnPv4mK9GDkvwr1VWBfy50aBZBUbkv/UzgvkE9HGhL8Ulu/dzYdUApZp4/XEJwx30Sq TL5Q== X-Gm-Message-State: ALoCoQn2JJHUBBNMRysvS7uaca1uk6fd4mxZNG0oZDgk97oDd9m4r++J5nCuuU/NaLRlmWhCB9Qk X-Received: by 10.152.4.229 with SMTP id n5mr1609669lan.1.1425569588066; Thu, 05 Mar 2015 07:33:08 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.13 with SMTP id n13ls347893laa.80.gmail; Thu, 05 Mar 2015 07:33:07 -0800 (PST) X-Received: by 10.152.8.229 with SMTP id u5mr8586317laa.4.1425569587927; Thu, 05 Mar 2015 07:33:07 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id t5si4702838lat.168.2015.03.05.07.33.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 07:33:07 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by lbiz11 with SMTP id z11so26142832lbi.3 for ; Thu, 05 Mar 2015 07:33:07 -0800 (PST) X-Received: by 10.112.162.232 with SMTP id yd8mr8406149lbb.41.1425569587847; Thu, 05 Mar 2015 07:33:07 -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 h5csp558422lbj; Thu, 5 Mar 2015 07:33:07 -0800 (PST) X-Received: by 10.112.162.232 with SMTP id yd8mr8406114lbb.41.1425569587395; Thu, 05 Mar 2015 07:33:07 -0800 (PST) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id m7si4708763laa.157.2015.03.05.07.33.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Mar 2015 07:33:07 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by labgm9 with SMTP id gm9so12547793lab.7 for ; Thu, 05 Mar 2015 07:33:07 -0800 (PST) X-Received: by 10.152.10.98 with SMTP id h2mr8549194lab.18.1425569587271; Thu, 05 Mar 2015 07:33:07 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id i5sm1324386lbb.40.2015.03.05.07.33.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Mar 2015 07:33:05 -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 1/2] mmc: sdhci-spear: Simplify by adding build dependency to CONFIG_OF Date: Thu, 5 Mar 2015 16:33:00 +0100 Message-Id: <1425569580-20347-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.217.177 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: , This driver is used on SoCs which are using CONFIG_OF. By adding a compile dependency in the Kconfig, it enables us to simplify some code. Signed-off-by: Ulf Hansson --- drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/sdhci-spear.c | 20 ++++---------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 2f850ac..7f4db90 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -255,6 +255,7 @@ config MMC_SDHCI_PXAV2 config MMC_SDHCI_SPEAR tristate "SDHCI support on ST SPEAr platform" depends on MMC_SDHCI && PLAT_SPEAR + depends on OF help This selects the Secure Digital Host Controller Interface (SDHCI) often referrered to as the HSMMC block in some of the ST SPEAR range diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c index 22e5826..f482f7f 100644 --- a/drivers/mmc/host/sdhci-spear.c +++ b/drivers/mmc/host/sdhci-spear.c @@ -44,7 +44,6 @@ static const struct sdhci_ops sdhci_pltfm_ops = { .set_uhs_signaling = sdhci_set_uhs_signaling, }; -#ifdef CONFIG_OF static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; @@ -66,16 +65,9 @@ static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pde return pdata; } -#else -static struct sdhci_plat_data *sdhci_probe_config_dt(struct platform_device *pdev) -{ - return ERR_PTR(-ENOSYS); -} -#endif static int sdhci_probe(struct platform_device *pdev) { - struct device_node *np = pdev->dev.of_node; struct sdhci_host *host; struct resource *iomem; struct spear_sdhci *sdhci; @@ -124,14 +116,10 @@ static int sdhci_probe(struct platform_device *pdev) dev_dbg(&pdev->dev, "Error setting desired clk, clk=%lu\n", clk_get_rate(sdhci->clk)); - if (np) { - 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; - } - } else { - sdhci->data = dev_get_platdata(&pdev->dev); + 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; } /*