Commit 0b3330f3 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Wim Van Sebroeck

watchdog: omap: simplify assignment of bootstatus

Instead of using an over-long expression involving the ?: operator use
an if and instead of an else branch rely on the fact that the data
structure was allocated using devm_kzalloc. This also allows to put the
used helper variable into a more local scope.

There is no functional change.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: default avatarFelipe Balbi <balbi@ti.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent d2f78268
...@@ -209,7 +209,6 @@ static int omap_wdt_probe(struct platform_device *pdev) ...@@ -209,7 +209,6 @@ static int omap_wdt_probe(struct platform_device *pdev)
struct omap_wd_timer_platform_data *pdata = dev_get_platdata(&pdev->dev); struct omap_wd_timer_platform_data *pdata = dev_get_platdata(&pdev->dev);
struct resource *res; struct resource *res;
struct omap_wdt_dev *wdev; struct omap_wdt_dev *wdev;
u32 rs;
int ret; int ret;
wdev = devm_kzalloc(&pdev->dev, sizeof(*wdev), GFP_KERNEL); wdev = devm_kzalloc(&pdev->dev, sizeof(*wdev), GFP_KERNEL);
...@@ -242,12 +241,11 @@ static int omap_wdt_probe(struct platform_device *pdev) ...@@ -242,12 +241,11 @@ static int omap_wdt_probe(struct platform_device *pdev)
pm_runtime_enable(wdev->dev); pm_runtime_enable(wdev->dev);
pm_runtime_get_sync(wdev->dev); pm_runtime_get_sync(wdev->dev);
if (pdata && pdata->read_reset_sources) if (pdata && pdata->read_reset_sources) {
rs = pdata->read_reset_sources(); u32 rs = pdata->read_reset_sources();
else if (rs & (1 << OMAP_MPU_WD_RST_SRC_ID_SHIFT))
rs = 0; wdev->wdog.bootstatus = WDIOF_CARDRESET;
wdev->wdog.bootstatus = (rs & (1 << OMAP_MPU_WD_RST_SRC_ID_SHIFT)) ? }
WDIOF_CARDRESET : 0;
omap_wdt_disable(wdev); omap_wdt_disable(wdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment