mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/3] mci: remove now-duplicate dev->detect implementations in host drivers
Date: Sun, 17 May 2020 20:19:40 +0200	[thread overview]
Message-ID: <20200517181941.6982-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20200517181941.6982-1-a.fatoum@pengutronix.de>

Previous commit introduced a fall-back MCI hw_dev->detect
implementation. All drivers touched in this commit populate hw_dev, so
lets drop their now-superfluous detect implementations.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mci/bcm2835-sdhost.c | 10 ----------
 drivers/mci/dove-sdhci.c     |  8 --------
 drivers/mci/dw_mmc.c         | 11 -----------
 drivers/mci/imx-esdhc.c      | 11 -----------
 drivers/mci/mci-bcm2835.c    | 10 ----------
 drivers/mci/mxs.c            |  9 ---------
 drivers/mci/omap_hsmmc.c     | 10 ----------
 drivers/mci/tegra-sdmmc.c    | 10 ----------
 8 files changed, 79 deletions(-)

diff --git a/drivers/mci/bcm2835-sdhost.c b/drivers/mci/bcm2835-sdhost.c
index 1d3a6c096910..f935ed5ea713 100644
--- a/drivers/mci/bcm2835-sdhost.c
+++ b/drivers/mci/bcm2835-sdhost.c
@@ -579,13 +579,6 @@ static void bcm2835_set_ios(struct mci_host *mci, struct mci_ios *ios)
 	writel(hcfg, host->regs + SDHCFG);
 }
 
-static int bcm2835_sdhost_detect(struct device_d *dev)
-{
-	struct bcm2835_host *host = dev->priv;
-
-	return mci_detect_card(&host->mci);
-}
-
 static int bcm2835_sdhost_probe(struct device_d *dev)
 {
 	struct bcm2835_host *host;
@@ -617,9 +610,6 @@ static int bcm2835_sdhost_probe(struct device_d *dev)
 	mci->set_ios = bcm2835_set_ios;
 	mci->send_cmd = bcm2835_send_cmd;
 
-	dev->priv = host;
-	dev->detect = bcm2835_sdhost_detect,
-
 	mci_of_parse(mci);
 
 	return mci_register(mci);
diff --git a/drivers/mci/dove-sdhci.c b/drivers/mci/dove-sdhci.c
index cb052e81b1e4..e09147fff9f7 100644
--- a/drivers/mci/dove-sdhci.c
+++ b/drivers/mci/dove-sdhci.c
@@ -324,12 +324,6 @@ static void dove_sdhci_set_mci_caps(struct dove_sdhci *host)
 		host->mci.host_caps &= ~MMC_CAP_8_BIT_DATA;
 }
 
-static int dove_sdhci_detect(struct device_d *dev)
-{
-	struct dove_sdhci *host = dev->priv;
-	return mci_detect_card(&host->mci);
-}
-
 static int dove_sdhci_probe(struct device_d *dev)
 {
 	struct dove_sdhci *host;
@@ -350,8 +344,6 @@ static int dove_sdhci_probe(struct device_d *dev)
 	host->sdhci.write32 = dove_sdhci_writel;
 	host->sdhci.write16 = dove_sdhci_writew;
 	host->sdhci.write8 = dove_sdhci_writeb;
-	dev->priv = host;
-	dev->detect = dove_sdhci_detect;
 
 	dove_sdhci_set_mci_caps(host);
 
diff --git a/drivers/mci/dw_mmc.c b/drivers/mci/dw_mmc.c
index f035317ef285..ab8270814b86 100644
--- a/drivers/mci/dw_mmc.c
+++ b/drivers/mci/dw_mmc.c
@@ -553,13 +553,6 @@ static int dwmci_init(struct mci_host *mci, struct device_d *dev)
 	return 0;
 }
 
-static int dw_mmc_detect(struct device_d *dev)
-{
-	struct dwmci_host *host = dev->priv;
-
-	return mci_detect_card(&host->mci);
-}
-
 static int dw_mmc_probe(struct device_d *dev)
 {
 	struct resource *iores;
@@ -615,8 +608,6 @@ static int dw_mmc_probe(struct device_d *dev)
 	else
 		host->pwren_value = 1;
 
-	dev->detect = dw_mmc_detect;
-
 	host->clkrate = clk_get_rate(host->clk_ciu);
 	host->mci.f_min = host->clkrate / 510 / host->ciu_div;
 	if (host->mci.f_min < 200000)
@@ -625,8 +616,6 @@ static int dw_mmc_probe(struct device_d *dev)
 
 	mci_of_parse(&host->mci);
 
-	dev->priv = host;
-
 	return mci_register(&host->mci);
 }
 
diff --git a/drivers/mci/imx-esdhc.c b/drivers/mci/imx-esdhc.c
index bff8dd67ada2..314a2264f952 100644
--- a/drivers/mci/imx-esdhc.c
+++ b/drivers/mci/imx-esdhc.c
@@ -236,13 +236,6 @@ static int esdhc_init(struct mci_host *mci, struct device_d *dev)
 	return ret;
 }
 
-static int fsl_esdhc_detect(struct device_d *dev)
-{
-	struct fsl_esdhc_host *host = dev->priv;
-
-	return mci_detect_card(&host->mci);
-}
-
 static int fsl_esdhc_probe(struct device_d *dev)
 {
 	struct resource *iores;
@@ -311,8 +304,6 @@ static int fsl_esdhc_probe(struct device_d *dev)
 	host->mci.card_present = esdhc_card_present;
 	host->mci.hw_dev = dev;
 
-	dev->detect = fsl_esdhc_detect;
-
 	rate = clk_get_rate(host->clk);
 	host->mci.f_min = rate >> 12;
 	if (host->mci.f_min < 200000)
@@ -325,8 +316,6 @@ static int fsl_esdhc_probe(struct device_d *dev)
 
 	mci_of_parse(&host->mci);
 
-	dev->priv = host;
-
 	ret = mci_register(&host->mci);
 	if (ret)
 		goto err_release_res;
diff --git a/drivers/mci/mci-bcm2835.c b/drivers/mci/mci-bcm2835.c
index b18d681870a5..c463c623e75f 100644
--- a/drivers/mci/mci-bcm2835.c
+++ b/drivers/mci/mci-bcm2835.c
@@ -366,13 +366,6 @@ static int bcm2835_mci_reset(struct mci_host *mci, struct device_d *mci_dev)
 	return bcm2835_mci_wait_command_done(host);
 }
 
-static int bcm2835_mci_detect(struct device_d *dev)
-{
-	struct bcm2835_mci_host *host = dev->priv;
-
-	return mci_detect_card(&host->mci);
-}
-
 static int bcm2835_mci_probe(struct device_d *hw_dev)
 {
 	struct resource *iores;
@@ -422,9 +415,6 @@ static int bcm2835_mci_probe(struct device_d *hw_dev)
 	host->mci.f_min = MIN_FREQ;
 	host->mci.f_max = host->max_clock;
 
-	hw_dev->priv = host;
-	hw_dev->detect = bcm2835_mci_detect,
-
 	/*
 	 * The Arasan has a bugette whereby it may lose the content of
 	 * successive writes to registers that are within two SD-card clock
diff --git a/drivers/mci/mxs.c b/drivers/mci/mxs.c
index 5e9f17def8eb..afd6a563970d 100644
--- a/drivers/mci/mxs.c
+++ b/drivers/mci/mxs.c
@@ -542,13 +542,6 @@ static void mxs_mci_info(struct device_d *hw_dev)
 	printf("\n");
 }
 
-static int mxs_mmc_detect(struct device_d *dev)
-{
-	struct mxs_mci_host *mxs_mci = dev->priv;
-
-	return mci_detect_card(&mxs_mci->host);
-}
-
 static int mxs_mci_probe(struct device_d *hw_dev)
 {
 	struct resource *iores;
@@ -584,8 +577,6 @@ static int mxs_mci_probe(struct device_d *hw_dev)
 		mci_of_parse(host);
 	}
 
-	hw_dev->detect = mxs_mmc_detect;
-
 	mxs_mci->clk = clk_get(hw_dev, NULL);
 	if (IS_ERR(mxs_mci->clk))
 		return PTR_ERR(mxs_mci->clk);
diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
index fe0cd47a2822..b14161032594 100644
--- a/drivers/mci/omap_hsmmc.c
+++ b/drivers/mci/omap_hsmmc.c
@@ -581,13 +581,6 @@ static void mmc_set_ios(struct mci_host *mci, struct mci_ios *ios)
 	writel(readl(&mmc_base->sysctl) | CEN_ENABLE, &mmc_base->sysctl);
 }
 
-static int omap_mmc_detect(struct device_d *dev)
-{
-	struct omap_hsmmc *hsmmc = dev->priv;
-
-	return mci_detect_card(&hsmmc->mci);
-}
-
 static int omap_mmc_probe(struct device_d *dev)
 {
 	struct resource *iores;
@@ -633,9 +626,6 @@ static int omap_mmc_probe(struct device_d *dev)
 
 	mci_of_parse(&hsmmc->mci);
 
-	dev->priv = hsmmc;
-	dev->detect = omap_mmc_detect,
-
 	mci_register(&hsmmc->mci);
 
 	return 0;
diff --git a/drivers/mci/tegra-sdmmc.c b/drivers/mci/tegra-sdmmc.c
index 1cc75dc524d4..15e33b85c598 100644
--- a/drivers/mci/tegra-sdmmc.c
+++ b/drivers/mci/tegra-sdmmc.c
@@ -379,13 +379,6 @@ static int tegra_sdmmc_card_present(struct mci_host *mci)
 	return !(sdhci_read32(&host->sdhci, SDHCI_PRESENT_STATE) & SDHCI_WRITE_PROTECT);
 }
 
-static int tegra_sdmmc_detect(struct device_d *dev)
-{
-	struct tegra_sdmmc_host *host = dev->priv;
-
-	return mci_detect_card(&host->mci);
-}
-
 static void tegra_sdmmc_parse_dt(struct tegra_sdmmc_host *host)
 {
 	struct device_node *np = host->mci.hw_dev->device_node;
@@ -459,9 +452,6 @@ static int tegra_sdmmc_probe(struct device_d *dev)
 	mci->host_caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED_52MHZ |
 	                  MMC_CAP_SD_HIGHSPEED;
 
-	dev->priv = host;
-	dev->detect = tegra_sdmmc_detect;
-
 	return mci_register(&host->mci);
 }
 
-- 
2.26.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2020-05-17 18:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 18:19 [PATCH 1/3] mci: define fall-back hw_dev->detect for all MCIs Ahmad Fatoum
2020-05-17 18:19 ` Ahmad Fatoum [this message]
2020-05-17 18:19 ` [PATCH 3/3] mci: reword MCI_STARTUP text Ahmad Fatoum
2020-05-18  6:17 ` [PATCH 1/3] mci: define fall-back hw_dev->detect for all MCIs Sascha Hauer
2020-06-02  8:00 Ahmad Fatoum
2020-06-02  8:00 ` [PATCH 2/3] mci: remove now-duplicate dev->detect implementations in host drivers Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200517181941.6982-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox