summaryrefslogtreecommitdiff
path: root/drivers/memory/atmel-ebi.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/atmel-ebi.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/atmel-ebi.c')
-rw-r--r--drivers/memory/atmel-ebi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
index ec6100bc94c5..e8bb5f37f5cb 100644
--- a/drivers/memory/atmel-ebi.c
+++ b/drivers/memory/atmel-ebi.c
@@ -12,7 +12,10 @@
#include <linux/mfd/syscon/atmel-matrix.h>
#include <linux/mfd/syscon/atmel-smc.h>
#include <linux/init.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/regmap.h>
#include <soc/at91/atmel-sfr.h>
@@ -515,16 +518,11 @@ static int atmel_ebi_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct device_node *child, *np = dev->of_node, *smc_np;
- const struct of_device_id *match;
struct atmel_ebi *ebi;
int ret, reg_cells;
struct clk *clk;
u32 val;
- match = of_match_device(atmel_ebi_id_table, dev);
- if (!match || !match->data)
- return -EINVAL;
-
ebi = devm_kzalloc(dev, sizeof(*ebi), GFP_KERNEL);
if (!ebi)
return -ENOMEM;
@@ -532,7 +530,9 @@ static int atmel_ebi_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ebi);
INIT_LIST_HEAD(&ebi->devs);
- ebi->caps = match->data;
+ ebi->caps = device_get_match_data(dev);
+ if (!ebi->caps)
+ return -EINVAL;
ebi->dev = dev;
clk = devm_clk_get(dev, NULL);