public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tilman Schmidt <t.schmidt@phoenixsoftware.de>
To: Greg KH <gregkh@suse.de>
Cc: Hansjoerg Lipp <hjlipp@web.de>, Karsten Keil <kkeil@suse.de>,
	i4ldeveloper@listserv.isdn4linux.de,
	linux-usb-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Tilman Schmidt <tilman@imap.cc>
Subject: advice on using dev_info(), dev_err() and friends (was: [PATCH 2/9] isdn4linux: Siemens Gigaset drivers - common module)
Date: Tue, 21 Feb 2006 18:01:14 +0100	[thread overview]
Message-ID: <43FB475A.5050108@phoenixsoftware.de> (raw)
In-Reply-To: <20060215032659.GB5099@suse.de>

Hello Greg,

thank you for your comments. Just a few follow-up questions.

On 15.02.2006 04:27, Greg KH wrote:
> On Sat, Feb 11, 2006 at 03:52:27PM +0100, Hansjoerg Lipp wrote:
> 
>>--- linux-2.6.16-rc2/drivers/isdn/gigaset/gigaset.h	1970-01-01 01:00:00.000000000 +0100
>>+++ linux-2.6.16-rc2-gig/drivers/isdn/gigaset/gigaset.h	2006-02-11 15:20:26.000000000 +0100
[...]
>>+#undef info
>>+#define info(format, arg...) printk(KERN_INFO "%s: " format "\n", THIS_MODULE ? THIS_MODULE->name : "gigaset_hw" , ## arg)
> 
> Care to use the dev_info(), dev_err() and other dev_* friends instead of
> rolling your own?  It gives you a much easier and standardised way of
> identifying the driver and individual device that the message is
> happening for.

This turns out to be surprisingly tricky, as these macros take a device
pointer argument which mustn't be NULL either.

Could you please advise how to use these when I do not have a device
pointer available (ie. before the probe method has been called) or when
there is a risk of it being no longer valid (ie. the USB device has been
unplugged)? I can detect both cases by checking for dev==NULL, but then
what do I do if it is? Is there a dummy device structure somewhere which
I could then use instead? Somehow, replacing all our occurrences of
	info("m%sg", args);
with
	if (cs->dev)
		dev_info(cs->dev, "m%sg\n", args);
	else
		printk(KERN_INFO "gigaset: m%sg\n", args);
doesn't really appeal to me. :-)

Thanks
Tilman

  reply	other threads:[~2006-02-21 17:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-11 14:52 [PATCH 0/9] isdn4linux: add drivers for Siemens Gigaset ISDN DECT PABX Hansjoerg Lipp
2006-02-11 14:52 ` [PATCH 1/9] isdn4linux: Siemens Gigaset drivers - Kconfigs and Makefiles Hansjoerg Lipp
2006-02-11 14:52   ` [PATCH 2/9] isdn4linux: Siemens Gigaset drivers - common module Hansjoerg Lipp
2006-02-11 14:52     ` [PATCH 3/9] isdn4linux: Siemens Gigaset drivers - event layer Hansjoerg Lipp
2006-02-11 14:52       ` [PATCH 4/9] isdn4linux: Siemens Gigaset drivers - isdn4linux interface Hansjoerg Lipp
2006-02-11 14:52         ` [PATCH 5/9] isdn4linux: Siemens Gigaset drivers - tty interface Hansjoerg Lipp
2006-02-11 14:52           ` [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface Hansjoerg Lipp
2006-02-11 14:52             ` [PATCH 7/9] isdn4linux: Siemens Gigaset drivers - direct USB connection Hansjoerg Lipp
2006-02-11 14:52               ` [PATCH 8/9] isdn4linux: Siemens Gigaset drivers - isochronous data handler Hansjoerg Lipp
2006-02-11 14:52                 ` [PATCH 9/9] isdn4linux: Siemens Gigaset drivers - M105 USB DECT adapter Hansjoerg Lipp
2006-02-15  3:35                   ` Greg KH
2006-02-15  3:33               ` [PATCH 7/9] isdn4linux: Siemens Gigaset drivers - direct USB connection Greg KH
2006-02-12 10:27             ` [PATCH 6/9] isdn4linux: Siemens Gigaset drivers - procfs interface Andrew Morton
2006-02-15  1:55               ` Tilman Schmidt
2006-02-15  3:22                 ` Andrew Morton
2006-02-15  3:30             ` Greg KH
2006-02-15  3:27     ` [PATCH 2/9] isdn4linux: Siemens Gigaset drivers - common module Greg KH
2006-02-21 17:01       ` Tilman Schmidt [this message]
2006-02-21 23:00         ` advice on using dev_info(), dev_err() and friends (was: [PATCH 2/9] isdn4linux: Siemens Gigaset drivers - common module) Greg KH
2006-02-15  4:13     ` [PATCH 2/9] isdn4linux: Siemens Gigaset drivers - common module Nishanth Aravamudan
2006-02-15  3:19   ` [PATCH 1/9] isdn4linux: Siemens Gigaset drivers - Kconfigs and Makefiles Greg KH
2006-02-16 21:30     ` Tilman Schmidt
2006-02-21 17:16     ` how to handle multi-part patch dependencies (was: [PATCH 1/9] isdn4linux: Siemens Gigaset drivers - Kconfigs and Makefiles) Tilman Schmidt
2006-02-21 23:01       ` Greg KH
2006-02-12 10:29 ` [PATCH 0/9] isdn4linux: add drivers for Siemens Gigaset ISDN DECT PABX Andrew Morton

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=43FB475A.5050108@phoenixsoftware.de \
    --to=t.schmidt@phoenixsoftware.de \
    --cc=gregkh@suse.de \
    --cc=hjlipp@web.de \
    --cc=i4ldeveloper@listserv.isdn4linux.de \
    --cc=kkeil@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=tilman@imap.cc \
    /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