@@ -47,15 +47,17 @@ struct imx7ulp_wdt_device {
47
47
struct clk * clk ;
48
48
};
49
49
50
- static inline void imx7ulp_wdt_enable (void __iomem * base , bool enable )
50
+ static inline void imx7ulp_wdt_enable (struct watchdog_device * wdog , bool enable )
51
51
{
52
- u32 val = readl ( base + WDOG_CS );
52
+ struct imx7ulp_wdt_device * wdt = watchdog_get_drvdata ( wdog );
53
53
54
- writel (UNLOCK , base + WDOG_CNT );
54
+ u32 val = readl (wdt -> base + WDOG_CS );
55
+
56
+ writel (UNLOCK , wdt -> base + WDOG_CNT );
55
57
if (enable )
56
- writel (val | WDOG_CS_EN , base + WDOG_CS );
58
+ writel (val | WDOG_CS_EN , wdt -> base + WDOG_CS );
57
59
else
58
- writel (val & ~WDOG_CS_EN , base + WDOG_CS );
60
+ writel (val & ~WDOG_CS_EN , wdt -> base + WDOG_CS );
59
61
}
60
62
61
63
static inline bool imx7ulp_wdt_is_enabled (void __iomem * base )
@@ -76,18 +78,15 @@ static int imx7ulp_wdt_ping(struct watchdog_device *wdog)
76
78
77
79
static int imx7ulp_wdt_start (struct watchdog_device * wdog )
78
80
{
79
- struct imx7ulp_wdt_device * wdt = watchdog_get_drvdata (wdog );
80
81
81
- imx7ulp_wdt_enable (wdt -> base , true);
82
+ imx7ulp_wdt_enable (wdog , true);
82
83
83
84
return 0 ;
84
85
}
85
86
86
87
static int imx7ulp_wdt_stop (struct watchdog_device * wdog )
87
88
{
88
- struct imx7ulp_wdt_device * wdt = watchdog_get_drvdata (wdog );
89
-
90
- imx7ulp_wdt_enable (wdt -> base , false);
89
+ imx7ulp_wdt_enable (wdog , false);
91
90
92
91
return 0 ;
93
92
}
0 commit comments