mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: ulf.hansson@linaro.org, adrian.hunter@intel.com,
	linus.walleij@linaro.org, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: beanhuo@micron.com
Subject: [PATCH v1 1/2] mmc: sdhci-omap: Use of_device_get_match_data() helper
Date: Sun, 24 Apr 2022 00:16:22 +0200	[thread overview]
Message-ID: <20220423221623.1074556-2-huobean@gmail.com> (raw)
In-Reply-To: <20220423221623.1074556-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 | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
index 64e27c2821f9..86e867ffbb10 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 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.34.1


  reply	other threads:[~2022-04-23 22:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-23 22:16 [PATCH v1 0/2] Two changes for eMMC Bean Huo
2022-04-23 22:16 ` Bean Huo [this message]
2022-04-26 13:55   ` [PATCH v1 1/2] mmc: sdhci-omap: Use of_device_get_match_data() helper Ulf Hansson
2022-04-23 22:16 ` [PATCH v1 2/2] mmc: core: Allows to override the timeout value for ioctl() path Bean Huo
2022-04-24 11:52   ` Avri Altman
2022-04-24 13:29   ` Linus Walleij
2022-04-25 20:01     ` Bean Huo
2022-04-25 20:15       ` Linus Walleij
2022-04-26 13:32         ` Ulf Hansson
2022-04-26 13:55   ` Ulf Hansson
2022-04-26 15:35     ` Linus Walleij

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=20220423221623.1074556-2-huobean@gmail.com \
    --to=huobean@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=beanhuo@micron.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®