Skip to content

Commit 4261ff5

Browse files
andy-shevUlf Hansson
authored andcommitted
mmc: sdhci-pltfm: Make driver OF independent
Since we have device_is_compatible() API, drop OF dependency in the driver. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/20231006105803.3374241-2-andriy.shevchenko@linux.intel.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 34457e4 commit 4261ff5

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

drivers/mmc/host/sdhci-pltfm.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <linux/err.h>
2020
#include <linux/module.h>
2121
#include <linux/property.h>
22-
#include <linux/of.h>
2322
#ifdef CONFIG_PPC
2423
#include <asm/machdep.h>
2524
#endif
@@ -56,19 +55,16 @@ static bool sdhci_wp_inverted(struct device *dev)
5655

5756
static void sdhci_get_compatibility(struct platform_device *pdev)
5857
{
58+
struct device *dev = &pdev->dev;
5959
struct sdhci_host *host = platform_get_drvdata(pdev);
60-
struct device_node *np = pdev->dev.of_node;
61-
62-
if (!np)
63-
return;
6460

65-
if (of_device_is_compatible(np, "fsl,p2020-rev1-esdhc"))
61+
if (device_is_compatible(dev, "fsl,p2020-rev1-esdhc"))
6662
host->quirks |= SDHCI_QUIRK_BROKEN_DMA;
6763

68-
if (of_device_is_compatible(np, "fsl,p2020-esdhc") ||
69-
of_device_is_compatible(np, "fsl,p1010-esdhc") ||
70-
of_device_is_compatible(np, "fsl,t4240-esdhc") ||
71-
of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
64+
if (device_is_compatible(dev, "fsl,p2020-esdhc") ||
65+
device_is_compatible(dev, "fsl,p1010-esdhc") ||
66+
device_is_compatible(dev, "fsl,t4240-esdhc") ||
67+
device_is_compatible(dev, "fsl,mpc8536-esdhc"))
7268
host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
7369
}
7470

0 commit comments

Comments
 (0)