mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-07-05 21:35:46 +02:00
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>
This commit is contained in:
parent
725b6a89ed
commit
c7e2f4e672
|
@ -15,7 +15,6 @@
|
||||||
#include <linux/mfd/syscon.h>
|
#include <linux/mfd/syscon.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_platform.h>
|
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/regmap.h>
|
#include <linux/regmap.h>
|
||||||
#include <linux/watchdog.h>
|
#include <linux/watchdog.h>
|
||||||
|
@ -42,7 +41,7 @@ struct st_wdog {
|
||||||
void __iomem *base;
|
void __iomem *base;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct regmap *regmap;
|
struct regmap *regmap;
|
||||||
struct st_wdog_syscfg *syscfg;
|
const struct st_wdog_syscfg *syscfg;
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
unsigned long clkrate;
|
unsigned long clkrate;
|
||||||
bool warm_reset;
|
bool warm_reset;
|
||||||
|
@ -150,7 +149,6 @@ static void st_clk_disable_unprepare(void *data)
|
||||||
static int st_wdog_probe(struct platform_device *pdev)
|
static int st_wdog_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
const struct of_device_id *match;
|
|
||||||
struct device_node *np = dev->of_node;
|
struct device_node *np = dev->of_node;
|
||||||
struct st_wdog *st_wdog;
|
struct st_wdog *st_wdog;
|
||||||
struct regmap *regmap;
|
struct regmap *regmap;
|
||||||
|
@ -173,12 +171,7 @@ static int st_wdog_probe(struct platform_device *pdev)
|
||||||
if (!st_wdog)
|
if (!st_wdog)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
match = of_match_device(st_wdog_match, dev);
|
st_wdog->syscfg = (struct st_wdog_syscfg *)device_get_match_data(dev);
|
||||||
if (!match) {
|
|
||||||
dev_err(dev, "Couldn't match device\n");
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
st_wdog->syscfg = (struct st_wdog_syscfg *)match->data;
|
|
||||||
|
|
||||||
base = devm_platform_ioremap_resource(pdev, 0);
|
base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (IS_ERR(base))
|
if (IS_ERR(base))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user