Re: [PATCH v2] watchdog: New watchdog driver for MEN A21 watchdogs

From: Joe Perches
Date: Tue May 14 2013 - 15:34:03 EST


On Tue, 2013-05-14 at 21:09 +0200, johannes.thumshirn@xxxxxx wrote:
> From: Johannes Thumshirn <johannes.thumshirn@xxxxxx>
>
> This patch adds the driver for the watchdog devices found on MEN Mikro
> Elektronik A21 VMEbus CPU Carrier Boards. It has DT-support and uses the
> watchdog framework.

trivia:

> diff --git a/drivers/watchdog/mena21_wdt.c b/drivers/watchdog/mena21_wdt.c

add:

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

before any #include to prefix pr_<level> messages.

> +#include <linux/module.h>
[]
> +static int a21_wdt_probe(struct platform_device *pdev)
> +{
> + struct a21_wdt_drv *drv;
> + int ret;
> +
> + dev_info(&pdev->dev, "MEN A21 watchdog timer driver enabled\n");
> +
> + drv = devm_kzalloc(&pdev->dev, sizeof(struct a21_wdt_drv), GFP_KERNEL);
> + if (!drv) {
> + dev_err(&pdev->dev,
> + "Unable to allocate memory for watchdog device\n");

OOM messages aren't particularly useful as all
failed memory allocations (without __GFP_NOWARN)
get a generic dump_stack().

> + ret = watchdog_register_device(&a21_wdt);
> + if (ret) {
> + pr_err("Cannot register watchdog device\n");
> + goto err_register_wd;
> + }
> +
> + ret = register_reboot_notifier(&a21_wdt_notifier);
> + if (ret) {
> + pr_err("Cannot register reboot notifier\n");
> + goto err_register_notif;
> + }
> +
> + ret = a21_wdt_create_files(&a21_wdt);
> + if (ret) {
> + dev_err(&pdev->dev, "Cannot create sysfs entries\n");
> + goto err_create_sysfs;
> + }

Mixing pr_err and dev_err may not be that useful.

Why not all dev_err? Then there'd be no pr_<level>
uses at all and you wouldn't need the pr_fmt either.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/