lkml.org 
[lkml]   [2013]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] watchdog: New watchdog driver for MEN A21 watchdogs
From
Date
On Tue, 2013-05-14 at 21:09 +0200, johannes.thumshirn@men.de wrote:
> From: Johannes Thumshirn <johannes.thumshirn@men.de>
>
> 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.




\
 
 \ /
  Last update: 2013-05-14 22:01    [W:0.101 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site