aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2014-02-12 08:41:25 -0500
committerWim Van Sebroeck <wim@iguana.be>2014-03-31 07:29:31 -0400
commit8d6a140b5f0def8c34d803474780b7b11fe0fab4 (patch)
tree5f351455fc832a30e0824d4597b58f64bcd858cd /drivers/watchdog
parentc9dcf9f2ea3d64602fe6230daba80f2ed811535b (diff)
watchdog: xilinx: Remove no_timeout variable
Remove no_timeout variable and check variables directly. Suggested-by: Rob Herring <robherring2@gmail.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/of_xilinx_wdt.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c
index 97370f63897c..57ccae8327ff 100644
--- a/drivers/watchdog/of_xilinx_wdt.c
+++ b/drivers/watchdog/of_xilinx_wdt.c
@@ -146,10 +146,9 @@ static u32 xwdt_selftest(struct xwdt_device *xdev)
146static int xwdt_probe(struct platform_device *pdev) 146static int xwdt_probe(struct platform_device *pdev)
147{ 147{
148 int rc; 148 int rc;
149 u32 pfreq, enable_once = 0; 149 u32 pfreq = 0, enable_once = 0;
150 struct resource *res; 150 struct resource *res;
151 struct xwdt_device *xdev; 151 struct xwdt_device *xdev;
152 bool no_timeout = false;
153 struct watchdog_device *xilinx_wdt_wdd; 152 struct watchdog_device *xilinx_wdt_wdd;
154 153
155 xdev = devm_kzalloc(&pdev->dev, sizeof(*xdev), GFP_KERNEL); 154 xdev = devm_kzalloc(&pdev->dev, sizeof(*xdev), GFP_KERNEL);
@@ -167,19 +166,15 @@ static int xwdt_probe(struct platform_device *pdev)
167 return PTR_ERR(xdev->base); 166 return PTR_ERR(xdev->base);
168 167
169 rc = of_property_read_u32(pdev->dev.of_node, "clock-frequency", &pfreq); 168 rc = of_property_read_u32(pdev->dev.of_node, "clock-frequency", &pfreq);
170 if (rc) { 169 if (rc)
171 dev_warn(&pdev->dev, 170 dev_warn(&pdev->dev,
172 "The watchdog clock frequency cannot be obtained\n"); 171 "The watchdog clock frequency cannot be obtained\n");
173 no_timeout = true;
174 }
175 172
176 rc = of_property_read_u32(pdev->dev.of_node, "xlnx,wdt-interval", 173 rc = of_property_read_u32(pdev->dev.of_node, "xlnx,wdt-interval",
177 &xdev->wdt_interval); 174 &xdev->wdt_interval);
178 if (rc) { 175 if (rc)
179 dev_warn(&pdev->dev, 176 dev_warn(&pdev->dev,
180 "Parameter \"xlnx,wdt-interval\" not found\n"); 177 "Parameter \"xlnx,wdt-interval\" not found\n");
181 no_timeout = true;
182 }
183 178
184 rc = of_property_read_u32(pdev->dev.of_node, "xlnx,wdt-enable-once", 179 rc = of_property_read_u32(pdev->dev.of_node, "xlnx,wdt-enable-once",
185 &enable_once); 180 &enable_once);
@@ -193,7 +188,7 @@ static int xwdt_probe(struct platform_device *pdev)
193 * Twice of the 2^wdt_interval / freq because the first wdt overflow is 188 * Twice of the 2^wdt_interval / freq because the first wdt overflow is
194 * ignored (interrupt), reset is only generated at second wdt overflow 189 * ignored (interrupt), reset is only generated at second wdt overflow
195 */ 190 */
196 if (!no_timeout) 191 if (pfreq && xdev->wdt_interval)
197 xilinx_wdt_wdd->timeout = 2 * ((1 << xdev->wdt_interval) / 192 xilinx_wdt_wdd->timeout = 2 * ((1 << xdev->wdt_interval) /
198 pfreq); 193 pfreq);
199 194