summaryrefslogtreecommitdiff
path: root/drivers/memory/brcmstb_memc.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-07 01:44:01 +0300
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>2023-10-12 16:42:16 +0300
commit09de3691daab15ae125cbf32f9f72fc90eada49d (patch)
treeeb94bbf2004c7db59ed5ecaa44abfb5e76f8c71e /drivers/memory/brcmstb_memc.c
parent9def28f3b8634e4f1fa92a77ccb65fbd2d03af34 (diff)
downloadlinux-09de3691daab15ae125cbf32f9f72fc90eada49d.tar.xz
memory: 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: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20231006224402.442078-1-robh@kernel.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Diffstat (limited to 'drivers/memory/brcmstb_memc.c')
-rw-r--r--drivers/memory/brcmstb_memc.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/memory/brcmstb_memc.c b/drivers/memory/brcmstb_memc.c
index 233a53f5bce1..a6ea51996522 100644
--- a/drivers/memory/brcmstb_memc.c
+++ b/drivers/memory/brcmstb_memc.c
@@ -8,8 +8,9 @@
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#define REG_MEMC_CNTRLR_CONFIG 0x00
#define CNTRLR_CONFIG_LPDDR4_SHIFT 5
@@ -121,12 +122,9 @@ static struct attribute_group dev_attr_group = {
.attrs = dev_attrs,
};
-static const struct of_device_id brcmstb_memc_of_match[];
-
static int brcmstb_memc_probe(struct platform_device *pdev)
{
const struct brcmstb_memc_data *memc_data;
- const struct of_device_id *of_id;
struct device *dev = &pdev->dev;
struct brcmstb_memc *memc;
int ret;
@@ -137,8 +135,7 @@ static int brcmstb_memc_probe(struct platform_device *pdev)
dev_set_drvdata(dev, memc);
- of_id = of_match_device(brcmstb_memc_of_match, dev);
- memc_data = of_id->data;
+ memc_data = device_get_match_data(dev);
memc->srpd_offset = memc_data->srpd_offset;
memc->ddr_ctrl = devm_platform_ioremap_resource(pdev, 0);