Skip to content

Commit c7e2f4e

Browse files
robherringWim Van Sebroeck
authored andcommitted
watchdog: st_lpc: 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: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20231009211356.3242037-18-robh@kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent 725b6a8 commit c7e2f4e

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

drivers/watchdog/st_lpc_wdt.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <linux/mfd/syscon.h>
1616
#include <linux/module.h>
1717
#include <linux/of.h>
18-
#include <linux/of_platform.h>
1918
#include <linux/platform_device.h>
2019
#include <linux/regmap.h>
2120
#include <linux/watchdog.h>
@@ -42,7 +41,7 @@ struct st_wdog {
4241
void __iomem *base;
4342
struct device *dev;
4443
struct regmap *regmap;
45-
struct st_wdog_syscfg *syscfg;
44+
const struct st_wdog_syscfg *syscfg;
4645
struct clk *clk;
4746
unsigned long clkrate;
4847
bool warm_reset;
@@ -150,7 +149,6 @@ static void st_clk_disable_unprepare(void *data)
150149
static int st_wdog_probe(struct platform_device *pdev)
151150
{
152151
struct device *dev = &pdev->dev;
153-
const struct of_device_id *match;
154152
struct device_node *np = dev->of_node;
155153
struct st_wdog *st_wdog;
156154
struct regmap *regmap;
@@ -173,12 +171,7 @@ static int st_wdog_probe(struct platform_device *pdev)
173171
if (!st_wdog)
174172
return -ENOMEM;
175173

176-
match = of_match_device(st_wdog_match, dev);
177-
if (!match) {
178-
dev_err(dev, "Couldn't match device\n");
179-
return -ENODEV;
180-
}
181-
st_wdog->syscfg = (struct st_wdog_syscfg *)match->data;
174+
st_wdog->syscfg = (struct st_wdog_syscfg *)device_get_match_data(dev);
182175

183176
base = devm_platform_ioremap_resource(pdev, 0);
184177
if (IS_ERR(base))

0 commit comments

Comments
 (0)