Re: [PATCH 1/4] export bus_kset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 13, 2011 at 07:11:48PM +0200, Davide Ciminaghi wrote:
> On Thu, May 12, 2011 at 09:28:53PM +0200, Rafael J. Wysocki wrote:
> 
> hi,
> 
> sorry, I missed this message this morning.
> 
> > On Thursday, May 12, 2011, Raffaele Recalcati wrote:
> > > From: Davide Ciminaghi <ciminaghi@xxxxxxxxx>
> > 
> > Please explain why you need to export it, what the alternatives are and
> > why you think this approach is better than the alternatives.
> > 
> 
> what I needed to do was walking through the list of registered busses,
> and invoking the bus_added()/bus_removed() callback of a newly registered
> policy. I couldn't find any other simple way to do it.
>
well, I there is another way to do that: adding a function like this
(include/linux/device.h) :

/**
 * run a callback for each registered bus type
 *
 * @data : arg passed to callback
 * @fn : pointer to callback
 */
int for_each_bus(void *data, int (*fn)(struct bus_type *bus, void *data));

which would be similar to the already existing bus_for_each_dev() and
would allow to avoid exporting a global variable.


Regards
Davide
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm


[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux