Skip to contentSkip to conversation

Can a kobject have both bus- and class-specific uevent handlers?

DISCUSSION Michael Tokarev 1 participant 1 message Jan 26, 2007

lore
Share & tools
lore
#0 lore raw

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