LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Can a kobject have both bus- and class-specific uevent handlers?
@ 2007-01-26 21:07 Michael Tokarev
  0 siblings, 0 replies; only message in thread
From: Michael Tokarev @ 2007-01-26 21:07 UTC (permalink / raw)
  To: linux-kernel

Looking at drivers/base/core.c:dev_uevent() I wonder whenever
a device can have both bus-specific uevent function AND
class-specific one.  If yes, the code in that routine is umm..
wrong.  Because in this case, bus-specific attributes will
be owerwritten by class-specific ones.

I mean this code (debugging omitted for simplicity):

    if (dev->bus && dev->bus->uevent) {
            /* have the bus specific function add its stuff */
            retval = dev->bus->uevent(dev, envp, num_envp, buffer, buffer_size);
    }

    if (dev->class && dev->class->dev_uevent) {
            /* have the class specific function add its stuff */
            retval = dev->class->dev_uevent(dev, envp, num_envp, buffer, buffer_size);
    }

    return retval;

Thanks.

/mjt

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-01-26 21:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-26 21:07 Can a kobject have both bus- and class-specific uevent handlers? Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).