Commit 0ab53e49 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Ulf Hansson
Browse files

mmc: sdhci-s3c: simplify getting of_device_id match data



Use of_device_get_match_data() to make the code slightly smaller and to
remove the of_device_id table forward declaration.

Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: default avatarSylwester Nawrocki <snawrocki@kernel.org>
Link: https://lore.kernel.org/r/20210415084412.51125-1-krzysztof.kozlowski@canonical.com


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 0751d56e
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <linux/gpio.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
@@ -461,19 +462,12 @@ static int sdhci_s3c_parse_dt(struct device *dev,
}
#endif

#ifdef CONFIG_OF
static const struct of_device_id sdhci_s3c_dt_match[];
#endif

static inline struct sdhci_s3c_drv_data *sdhci_s3c_get_driver_data(
			struct platform_device *pdev)
{
#ifdef CONFIG_OF
	if (pdev->dev.of_node) {
		const struct of_device_id *match;
		match = of_match_node(sdhci_s3c_dt_match, pdev->dev.of_node);
		return (struct sdhci_s3c_drv_data *)match->data;
	}
	if (pdev->dev.of_node)
		return (struct sdhci_s3c_drv_data *)of_device_get_match_data(&pdev->dev);
#endif
	return (struct sdhci_s3c_drv_data *)
			platform_get_device_id(pdev)->driver_data;