Re: patch driver-core-warn-about-duplicate-driver-names-on-the-same-bus.patchadded to gregkh-2.6 tree

From: Stas Sergeev
Date: Tue Apr 29 2008 - 00:48:39 EST


Hello.

gregkh@xxxxxxx wrote:
> This is a note to let you know that I've just added the patch titled
> Subject: driver core: warn about duplicate driver names on the same bus
> to my gregkh-2.6 tree. Its filename is
Thanks.

Takashi, do you think this fixes the
pcspkr/snd-pcsp conflict sufficienly
well? I think the Kconfig protection
is no longer needed. For the better
convinience the modprobe rule can be
created that will remove one driver
before inserting another. But this is
optional.
What do you think? Can we now remove
the Kconfig protection?


> driver-core-warn-about-duplicate-driver-names-on-the-same-bus.patch
>
> This tree can be found at
> http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
>
>
>>From stsp@xxxxxxxx Sat Apr 26 08:52:51 2008
> From: Stas Sergeev <stsp@xxxxxxxx>
> Date: Sat, 26 Apr 2008 19:52:35 +0400
> Subject: driver core: warn about duplicate driver names on the same bus
> To: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Greg KH <greg@xxxxxxxxx>, Takashi Iwai <tiwai@xxxxxxx>
> Message-ID: <48134FC3.6040002@xxxxxxxx>
>
>
> Currently an attempt to register multiple
> drivers with the same name causes the
> stack trace with some cryptic error message.
> The attached patch adds the necessary check
> and the clear error message.
>
> Signed-off-by: Stas Sergeev <stsp@xxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
>
> ---
> drivers/base/driver.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> --- a/drivers/base/driver.c
> +++ b/drivers/base/driver.c
> @@ -217,12 +217,22 @@ static void driver_remove_groups(struct
> int driver_register(struct device_driver *drv)
> {
> int ret;
> + struct device_driver *other;
>
> if ((drv->bus->probe && drv->probe) ||
> (drv->bus->remove && drv->remove) ||
> (drv->bus->shutdown && drv->shutdown))
> printk(KERN_WARNING "Driver '%s' needs updating - please use "
> "bus_type methods\n", drv->name);
> +
> + other = driver_find(drv->name, drv->bus);
> + if (other) {
> + put_driver(other);
> + printk(KERN_ERR "Error: Driver '%s' is already registered, "
> + "aborting...\n", drv->name);
> + return -EEXIST;
> + }
> +
> ret = bus_add_driver(drv);
> if (ret)
> return ret;
>
>
> Patches currently in gregkh-2.6 which might be from stsp@xxxxxxxx are
>
> driver-core/driver-core-warn-about-duplicate-driver-names-on-the-same-bus.patch
>

--
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/