Skip to content

Commit 6121d0b

Browse files
AaronDotWim Van Sebroeck
authored andcommitted
watchdog: loongson1: Simplify ls1x_wdt_probe code
Remove meaningless output to simplify ls1x_wdt_probe(). Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
1 parent f909b3d commit 6121d0b

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

drivers/watchdog/loongson1_wdt.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ static int ls1x_wdt_probe(struct platform_device *pdev)
108108
struct ls1x_wdt_drvdata *drvdata;
109109
struct watchdog_device *ls1x_wdt;
110110
unsigned long clk_rate;
111-
int err;
112111

113112
drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
114113
if (!drvdata)
115114
return -ENOMEM;
115+
platform_set_drvdata(pdev, drvdata);
116116

117117
drvdata->base = devm_platform_ioremap_resource(pdev, 0);
118118
if (IS_ERR(drvdata->base))
@@ -139,15 +139,7 @@ static int ls1x_wdt_probe(struct platform_device *pdev)
139139
watchdog_set_nowayout(ls1x_wdt, nowayout);
140140
watchdog_set_drvdata(ls1x_wdt, drvdata);
141141

142-
err = devm_watchdog_register_device(dev, &drvdata->wdt);
143-
if (err)
144-
return err;
145-
146-
platform_set_drvdata(pdev, drvdata);
147-
148-
dev_info(dev, "Loongson1 Watchdog driver registered\n");
149-
150-
return 0;
142+
return devm_watchdog_register_device(dev, &drvdata->wdt);
151143
}
152144

153145
#ifdef CONFIG_OF

0 commit comments

Comments
 (0)