lkml.org 
[lkml]   [2013]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [char-misc-next 02/11 V2] mei: bus: Implement driver registration
    On Sun, Feb 10, 2013 at 08:36:23AM -0800, Greg KH wrote:
    > On Sun, Feb 10, 2013 at 04:32:18AM +0100, Samuel Ortiz wrote:
    > > Hi Greg,
    > >
    > > On Fri, Feb 08, 2013 at 03:55:24PM -0800, Greg KH wrote:
    > > > On Fri, Feb 08, 2013 at 02:28:15PM +0200, Tomas Winkler wrote:
    > > > > From: Samuel Ortiz <sameo@linux.intel.com>
    > > > >
    > > > > Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
    > > > > Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
    > > > > Acked-by: Arnd Bergmann <arnd@arndb.de>
    > > > > ---
    > > > > drivers/misc/mei/bus.c | 29 +++++++++++++++++++++++++++++
    > > > > include/linux/mei_bus.h | 3 +++
    > > > > 2 files changed, 32 insertions(+), 0 deletions(-)
    > > > >
    > > > > diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
    > > > > index bb96423c..0a5e624 100644
    > > > > --- a/drivers/misc/mei/bus.c
    > > > > +++ b/drivers/misc/mei/bus.c
    > > > > @@ -153,3 +153,32 @@ void mei_remove_device(struct mei_bus_client *client)
    > > > > device_unregister(&client->dev);
    > > > > }
    > > > > EXPORT_SYMBOL(mei_remove_device);
    > > > > +
    > > > > +int mei_driver_register(struct mei_bus_driver *driver)
    > > > > +{
    > > > > + int err;
    > > > > +
    > > > > + /* Can't register until after driver model init */
    > > > > + if (unlikely(WARN_ON(!mei_bus_type.p)))
    > > > > + return -EAGAIN;
    > > >
    > > > No, you really don't know what 'p' is, so don't assume you do. You have
    > > > fields you can test to see if your driver model is up and registered,
    > > > use them instead.
    > > Unless I'm missing something, I would actually need to track if the bus type
    > > is registered or not from bus.c. I can't find any field from bus_type that
    > > tells me for sure if my bus is registered or not, except for p.
    > > I actually think I don't need that check anyway. IIRC, this is something I
    > > took from i2c-core.c but in the ME case it's most likely not needed.
    >
    > It's your bus, if you need to check this, then have your own flag, don't
    > poke in the driver core internals. As you point out, I don't think you
    > need to check this at all.
    Yes, I removed the check. Tomas should sent v3 later today with all your comments
    adressed.
    Thanks for the review.

    Cheers,
    Samuel.

    --
    Intel Open Source Technology Centre
    http://oss.intel.com/


    \
     
     \ /
      Last update: 2013-02-11 12:21    [W:2.236 / U:0.040 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site