summaryrefslogtreecommitdiff
path: root/drivers/nvmem/stm32-romem.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-20 13:55:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-21 20:19:15 +0300
commit0720219f4d34a88a9badb4de70cfad7585687d48 (patch)
treee4bcc5ebb8375b6f0d5441c9f03735f1f7469832 /drivers/nvmem/stm32-romem.c
parent716a8027efbb84291111764847d37cb0648ef69b (diff)
downloadlinux-0720219f4d34a88a9badb4de70cfad7585687d48.tar.xz
nvmem: 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> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20231020105545.216052-7-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvmem/stm32-romem.c')
-rw-r--r--drivers/nvmem/stm32-romem.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/nvmem/stm32-romem.c b/drivers/nvmem/stm32-romem.c
index 1541c20709d2..8a553b1799a8 100644
--- a/drivers/nvmem/stm32-romem.c
+++ b/drivers/nvmem/stm32-romem.c
@@ -10,7 +10,9 @@
#include <linux/io.h>
#include <linux/module.h>
#include <linux/nvmem-provider.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/tee_drv.h>
#include "stm32-bsec-optee-ta.h"
@@ -211,8 +213,7 @@ static int stm32_romem_probe(struct platform_device *pdev)
priv->lower = 0;
- cfg = (const struct stm32_romem_cfg *)
- of_match_device(dev->driver->of_match_table, dev)->data;
+ cfg = device_get_match_data(dev);
if (!cfg) {
priv->cfg.read_only = true;
priv->cfg.size = resource_size(res);