lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 10 Feb 2013 04:32:18 +0100
From:	Samuel Ortiz <sameo@...ux.intel.com>
To:	Greg KH <gregkh@...uxfoundation.org>
Cc:	Tomas Winkler <tomas.winkler@...el.com>, arnd@...db.de,
	linux-kernel@...r.kernel.org
Subject: Re: [char-misc-next 02/11 V2] mei: bus: Implement driver registration

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@...ux.intel.com>
> > 
> > Signed-off-by: Samuel Ortiz <sameo@...ux.intel.com>
> > Signed-off-by: Tomas Winkler <tomas.winkler@...el.com>
> > Acked-by: Arnd Bergmann <arnd@...db.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.


> > +	driver->driver.owner = THIS_MODULE;
> 
> Nope, this should be the module that owns the driver, not this one.  It
> needs to be passed in with the call, or as part of the driver structure.
That's right, I'll fix that.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ