static int qcom_wdt_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -273,8 +304,13 @@ static int qcom_wdt_probe(struct platform_device *pdev)
wdt->wdd.parent = dev;
wdt->layout = data->offset;
- if (readl(wdt_addr(wdt, WDT_STS)) & 1)
- wdt->wdd.bootstatus = WDIOF_CARDRESET;
+ ret = qcom_wdt_get_restart_reason(wdt, data);
+ if (ret == -ENODEV) {
+ if (readl(wdt_addr(wdt, WDT_STS)) & 1)
+ wdt->wdd.bootstatus = WDIOF_CARDRESET;
+ } else if (ret) {
+ return ret;
+ }
Seems odd to me that there is now a function qcom_wdt_get_restart_reason()
but it doesn't handle all means to get the restart reason. Maybe I missed it,
but what is the reason for that ? Why not move reading WDT_STS into
qcom_wdt_get_restart_reason() as well ?
Guenter
/*
* If 'timeout-sec' unspecified in devicetree, assume a 30 second