Re: patch bus_add_device-losing-an-error-return-from-the-probe-method.patch added to gregkh-2.6 tree

From: Dmitry Torokhov
Date: Tue Apr 04 2006 - 16:24:03 EST


On 4/4/06, gregkh@xxxxxxx <gregkh@xxxxxxx> wrote:
>
> --- gregkh-2.6.orig/drivers/base/bus.c
> +++ gregkh-2.6/drivers/base/bus.c
> @@ -372,14 +372,17 @@ int bus_add_device(struct device * dev)
>
> if (bus) {
> pr_debug("bus %s: add device %s\n", bus->name, dev->bus_id);
> - device_attach(dev);
> + error = device_attach(dev);
> + if (error < 0)
> + goto exit;

I do not believe that this is correct. The fact that _some_ driver
failed to attach to a device does not necessarily mean that device
itself does not exist. While this assuption might work for platform
devices it won't work for other busses.

As fasr as ALSA goes, if they want to abort loading module if device
is not present they will have to separate device probing from final
driver binding.

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/