mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: johannes.thumshirn@men.de
Cc: wim@iguana.be, linux-watchdog@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] watchdog: New watchdog driver for MEN A21 watchdogs
Date: Tue, 14 May 2013 12:33:54 -0700	[thread overview]
Message-ID: <1368560034.24692.4.camel@joe-AO722> (raw)
In-Reply-To: <1368558589-3156-1-git-send-email-johannes.thumshirn@men.de>

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.



  reply	other threads:[~2013-05-14 19:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13 20:58 [PATCH] " johannes.thumshirn
2013-05-13 22:44 ` Guenter Roeck
2013-05-14 19:09   ` [PATCH v2] " johannes.thumshirn
2013-05-14 19:33     ` Joe Perches [this message]
2013-05-15 18:50       ` [PATCH v3] " johannes.thumshirn
2013-05-26 14:34         ` Wim Van Sebroeck
2013-05-27  6:45           ` AW: " Thumshirn, Johannes Tobias
2013-05-27  9:07             ` Wim Van Sebroeck
2013-05-27 18:13               ` [PATCH v4 1/2] " johannes.thumshirn
2013-05-27 18:13                 ` [PATCH v4 2/2] watchdog: Add sysfs interface for MEN A21 watchdog johannes.thumshirn
2013-05-27 19:41                   ` Wim Van Sebroeck
2013-05-29  8:35                     ` Johannes Thumshirn
2013-05-30 22:00                       ` Wim Van Sebroeck
2013-05-27 18:25                 ` [PATCH v4 1/2] watchdog: New watchdog driver for MEN A21 watchdogs Wim Van Sebroeck
2013-05-28  8:10                   ` Johannes Thumshirn
2013-05-28 16:22                     ` Guenter Roeck
2013-05-29  8:14                       ` Johannes Thumshirn
2013-05-30 21:59                       ` Wim Van Sebroeck
2013-05-30 22:02                         ` Guenter Roeck
2013-05-31  8:24                           ` Johannes Thumshirn
2013-05-31  9:35                           ` anish singh
2013-05-31 10:09                             ` Guenter Roeck
2013-05-30 21:52                     ` Wim Van Sebroeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1368560034.24692.4.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=johannes.thumshirn@men.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®