syslog loves the new driver core code
From: Greg KH (gregkh_at_suse.de)
Date: 03/31/05
- Previous message: Jeff Garzik: "Re: [PATCH] Reduce stack usage in time.c"
- Next in thread: Patrick Mochel: "Re: syslog loves the new driver core code"
- Reply: Patrick Mochel: "Re: syslog loves the new driver core code"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 31 Mar 2005 00:28:14 -0800 To: Patrick Mochel <mochel@digitalimplant.org>, Andrew Morton <akpm@osdl.org>
Andrew pointed out to me that the new driver core code spewes a lot of
stuff in the syslog for every device it tries to match up with a driver
(if you look closely, it seems that the if check in __device_attach()
will never not trigger...)
Everything still seems to work properly, but it's good if we don't alarm
people with messages that are incorrect and unneeded. :)
So, here's a patch that seems to work for me. It stops trying to loop
through drivers or devices once it finds a match, and it only tells the
syslog when we have a real error.
Look acceptable to you?
thanks,
greg k-h
-----------
Driver core: Fix up the driver and device iterators to be quieter
Also stops looping over the lists when a match is found.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
--- 1.4/drivers/base/dd.c 2005-03-25 09:52:38 -08:00
+++ edited/drivers/base/dd.c 2005-03-31 00:22:50 -08:00
@@ -91,20 +91,23 @@ static int __device_attach(struct device
int error;
error = driver_probe_device(drv, dev);
-
- if (error == -ENODEV && error == -ENXIO) {
- /* Driver matched, but didn't support device
- * or device not found.
- * Not an error; keep going.
- */
- error = 0;
- } else {
- /* driver matched but the probe failed */
- printk(KERN_WARNING
- "%s: probe of %s failed with error %d\n",
- drv->name, dev->bus_id, error);
+ if (error) {
+ if ((error == -ENODEV) || (error == -ENXIO)) {
+ /* Driver matched, but didn't support device
+ * or device not found.
+ * Not an error; keep going.
+ */
+ error = 0;
+ } else {
+ /* driver matched but the probe failed */
+ printk(KERN_WARNING
+ "%s: probe of %s failed with error %d\n",
+ drv->name, dev->bus_id, error);
+ }
+ return error;
}
- return 0;
+ /* stop looking, this device is attached */
+ return 1;
}
@@ -142,7 +145,10 @@ static int __driver_attach(struct device
drv->name, dev->bus_id, error);
} else
error = 0;
+ return error;
}
+ /* stop looking, this driver is attached */
+ return 1;
}
return 0;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Jeff Garzik: "Re: [PATCH] Reduce stack usage in time.c"
- Next in thread: Patrick Mochel: "Re: syslog loves the new driver core code"
- Reply: Patrick Mochel: "Re: syslog loves the new driver core code"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: [PATCH] i2c driver fixes for 2.6.0-test7
... that was the bug:) ... It caused bad messages to show up in the syslog
whenever a i2c driver was removed, ... send the line "unsubscribe linux-kernel"
in ... (Linux-Kernel) - Re: HP USB Mass Storage device issue
... deals with scsi stuff. ... Still no dectection of the usb flash drive size in
the syslog with the ... > driver for your harddisk should be there (don't recall
its ... > - if not, detach, insmod manually, attach ... (Debian-User) - Re: [RFC] PCI: clean up the dynamic pci id logic
... > The dynamic pci id logic has been bothering me for a while, ... > I
started to look into how to move some of this to the driver core, ... send the line "unsubscribe
linux-kernel" in ... (Linux-Kernel) - Re: syslog loves the new driver core code
... On Thu, 31 Mar 2005, Greg KH wrote: ... > stuff in the syslog for every device
it tries to match up with a driver ... > syslog when we have a real error. ...
send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: Problems Mounting Digital Camera
... According to Romulo Sousa, ... > Controller Interface driver ...
insmod errors can be caused by incorrect module parameters, ... > You may find more
information in syslog or the output from dmesg ... (Debian-User)