Skip to content

Commit 897ae3f

Browse files
beanhuoUlf Hansson
authored andcommitted
mmc: sdhci-omap: Use of_device_get_match_data() helper
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> Link: https://lore.kernel.org/r/20220423221623.1074556-2-huobean@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent c766624 commit 897ae3f

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

drivers/mmc/host/sdhci-omap.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,16 +1219,11 @@ static int sdhci_omap_probe(struct platform_device *pdev)
12191219
struct sdhci_pltfm_host *pltfm_host;
12201220
struct sdhci_omap_host *omap_host;
12211221
struct mmc_host *mmc;
1222-
const struct of_device_id *match;
1223-
struct sdhci_omap_data *data;
1222+
const struct sdhci_omap_data *data;
12241223
const struct soc_device_attribute *soc;
12251224
struct resource *regs;
12261225

1227-
match = of_match_device(omap_sdhci_match, dev);
1228-
if (!match)
1229-
return -EINVAL;
1230-
1231-
data = (struct sdhci_omap_data *)match->data;
1226+
data = of_device_get_match_data(&pdev->dev);
12321227
if (!data) {
12331228
dev_err(dev, "no sdhci omap data\n");
12341229
return -EINVAL;

0 commit comments

Comments
 (0)