diff options
author | Rob Herring <robh@kernel.org> | 2023-10-09 19:28:56 +0200 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2023-10-16 11:13:27 +0200 |
commit | 6135e730f81d7fdb8864f9f8e102bcb8c8351552 (patch) | |
tree | f6df717398da9f1ab0e9fc1293795bbe7a76d8a7 /drivers/mtd/maps | |
parent | mtd: spi-nor: nxp-spifi: Convert to platform remove callback returning void (diff) | |
download | linux-6135e730f81d7fdb8864f9f8e102bcb8c8351552.tar.xz linux-6135e730f81d7fdb8864f9f8e102bcb8c8351552.zip |
mtd: 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: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20231009172923.2457844-1-robh@kernel.org
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r-- | drivers/mtd/maps/physmap-core.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/mtd/maps/physmap-core.c b/drivers/mtd/maps/physmap-core.c index b906a6d5369b..cc846b732eeb 100644 --- a/drivers/mtd/maps/physmap-core.c +++ b/drivers/mtd/maps/physmap-core.c @@ -30,6 +30,7 @@ #include <linux/slab.h> #include <linux/device.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/partitions.h> @@ -37,7 +38,7 @@ #include <linux/mtd/concat.h> #include <linux/mtd/cfi_endian.h> #include <linux/io.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/pm_runtime.h> #include <linux/gpio/consumer.h> @@ -295,14 +296,9 @@ static const char * const *of_get_part_probes(struct platform_device *dev) static const char *of_select_probe_type(struct platform_device *dev) { struct device_node *dp = dev->dev.of_node; - const struct of_device_id *match; const char *probe_type; - match = of_match_device(of_flash_match, &dev->dev); - if (!match) - return NULL; - - probe_type = match->data; + probe_type = device_get_match_data(&dev->dev); if (probe_type) return probe_type; |