public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: greg@kroah.com
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] fix dev_printk to work even in the absence of am attached driver
Date: 19 Apr 2004 15:39:57 -0500	[thread overview]
Message-ID: <1082407198.1804.35.camel@mulgrave> (raw)

dev_printk makes an incredibly convenient hook to hang a logging
infrastructure.  For that reason, it would be very useful to make all
device driver logging go through it.

Unfortunately in SCSI we can't do this yet because we need to log
messages even when the device doesn't have a bound driver (either
because the user has chosen not to load it or because we're starting up
or shutting down).

The attached makes dev_printk work even in the absence of a bound driver
so we should now be able to use it at all points in the lifecycle of a
SCSI device.

James
Index: include/linux/device.h
===================================================================
RCS file: /var/cvs/linux-2.6/include/linux/device.h,v
retrieving revision 1.9
diff -u -r1.9 device.h
--- a/include/linux/device.h	15 Apr 2004 18:05:25 -0000	1.9
+++ b/include/linux/device.h	19 Apr 2004 20:36:57 -0000
@@ -400,7 +400,7 @@
 
 /* debugging and troubleshooting/diagnostic helpers. */
 #define dev_printk(level, dev, format, arg...)	\
-	printk(level "%s %s: " format , (dev)->driver->name , (dev)->bus_id , ## arg)
+	printk(level "%s %s: " format , (dev)->driver ? (dev)->driver->name : "(unbound)", (dev)->bus_id , ## arg)
 
 #ifdef DEBUG
 #define dev_dbg(dev, format, arg...)		\




             reply	other threads:[~2004-04-19 20:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-19 20:39 James Bottomley [this message]
2004-04-22 22:07 ` [PATCH] fix dev_printk to work even in the absence of am attached driver Greg KH
2004-05-11 14:00   ` James Bottomley
2004-05-11 23:39     ` Greg KH

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=1082407198.1804.35.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /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