Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: jz4740: Use device_get_match_data()

Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20231006224343.441720-1-robh@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Rob Herring and committed by
Ulf Hansson
a2b8fa78 0ebebb21

+5 -10
+5 -10
drivers/mmc/host/jz4740_mmc.c
··· 18 18 #include <linux/mmc/host.h> 19 19 #include <linux/mmc/slot-gpio.h> 20 20 #include <linux/module.h> 21 - #include <linux/of_device.h> 21 + #include <linux/of.h> 22 22 #include <linux/pinctrl/consumer.h> 23 23 #include <linux/platform_device.h> 24 + #include <linux/property.h> 24 25 #include <linux/regulator/consumer.h> 25 26 #include <linux/scatterlist.h> 26 27 ··· 1041 1040 int ret; 1042 1041 struct mmc_host *mmc; 1043 1042 struct jz4740_mmc_host *host; 1044 - const struct of_device_id *match; 1045 1043 1046 1044 mmc = mmc_alloc_host(sizeof(struct jz4740_mmc_host), &pdev->dev); 1047 1045 if (!mmc) { ··· 1050 1050 1051 1051 host = mmc_priv(mmc); 1052 1052 1053 - match = of_match_device(jz4740_mmc_of_match, &pdev->dev); 1054 - if (match) { 1055 - host->version = (enum jz4740_mmc_version)match->data; 1056 - } else { 1057 - /* JZ4740 should be the only one using legacy probe */ 1058 - host->version = JZ_MMC_JZ4740; 1059 - } 1053 + /* Default if no match is JZ4740 */ 1054 + host->version = (enum jz4740_mmc_version)device_get_match_data(&pdev->dev); 1060 1055 1061 1056 ret = mmc_of_parse(mmc); 1062 1057 if (ret) { ··· 1195 1200 .driver = { 1196 1201 .name = "jz4740-mmc", 1197 1202 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 1198 - .of_match_table = of_match_ptr(jz4740_mmc_of_match), 1203 + .of_match_table = jz4740_mmc_of_match, 1199 1204 .pm = pm_sleep_ptr(&jz4740_mmc_pm_ops), 1200 1205 }, 1201 1206 };