public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: ulf.hansson@linaro.org, eugen.hristev@microchip.com,
	adrian.hunter@intel.com, nicolas.ferre@microchip.com,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: beanhuo@micron.com
Subject: [PATCH 3/5] mmc: sdhci-omap: Use of_device_get_match_data() helper
Date: Wed,  2 Feb 2022 19:06:46 +0100	[thread overview]
Message-ID: <20220202180648.1252154-4-huobean@gmail.com> (raw)
In-Reply-To: <20220202180648.1252154-1-huobean@gmail.com>

From: Bean Huo <beanhuo@micron.com>

Only the device data is needed, not the entire struct of_device_id.
Use of_device_get_match_data() instead of open coding of_match_device().

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/mmc/host/sdhci-omap.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
index 64e27c2821f9..676e3cbbfc95 100644
--- a/drivers/mmc/host/sdhci-omap.c
+++ b/drivers/mmc/host/sdhci-omap.c
@@ -1219,16 +1219,11 @@ static int sdhci_omap_probe(struct platform_device *pdev)
 	struct sdhci_pltfm_host *pltfm_host;
 	struct sdhci_omap_host *omap_host;
 	struct mmc_host *mmc;
-	const struct of_device_id *match;
 	struct sdhci_omap_data *data;
 	const struct soc_device_attribute *soc;
 	struct resource *regs;
 
-	match = of_match_device(omap_sdhci_match, dev);
-	if (!match)
-		return -EINVAL;
-
-	data = (struct sdhci_omap_data *)match->data;
+	data = of_device_get_match_data(&pdev->dev);
 	if (!data) {
 		dev_err(dev, "no sdhci omap data\n");
 		return -EINVAL;
-- 
2.25.1


  parent reply	other threads:[~2022-02-02 18:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02 18:06 [PATCH 0/5] Use of_device_get_match_data() helper Bean Huo
2022-02-02 18:06 ` [PATCH 1/5] mmc: wmt-sdmmc: " Bean Huo
2022-02-02 18:06 ` [PATCH 2/5] mmc: sdhci-tegra: " Bean Huo
2022-02-02 18:06 ` Bean Huo [this message]
2022-02-03  2:39   ` [PATCH 3/5] mmc: sdhci-omap: " kernel test robot
2022-02-03  4:21   ` kernel test robot
2022-02-02 18:06 ` [PATCH 4/5] mmc: sdhci-of-at91: " Bean Huo
2022-02-02 18:06 ` [PATCH 5/5] mmc: davinci: " Bean Huo
2022-02-08 15:12 ` [PATCH 0/5] " Ulf Hansson
2022-02-08 16:44   ` Bean Huo

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=20220202180648.1252154-4-huobean@gmail.com \
    --to=huobean@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=beanhuo@micron.com \
    --cc=eugen.hristev@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=ulf.hansson@linaro.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