mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Tomas Winkler <tomas.winkler@intel.com>
Cc: sameo@linux.intel.com, arnd@arndb.de, linux-kernel@vger.kernel.org
Subject: Re: [char-misc-next 02/11 V2] mei: bus: Implement driver registration
Date: Fri, 8 Feb 2013 15:55:24 -0800	[thread overview]
Message-ID: <20130208235524.GB24127@kroah.com> (raw)
In-Reply-To: <1360326504-17041-3-git-send-email-tomas.winkler@intel.com>

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.  Don't you think that something called 'p' is not
there for you to use?

> +	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.

> +	driver->driver.bus = &mei_bus_type;
> +
> +	err = driver_register(&driver->driver);
> +	if (err)
> +		return err;
> +
> +	pr_debug("mei: driver [%s] registered\n", driver->driver.name);
> +
> +	return 0;
> +}
> +EXPORT_SYMBOL(mei_driver_register);

_GPL() please?

> +
> +void mei_driver_unregister(struct mei_bus_driver *driver)
> +{
> +	driver_unregister(&driver->driver);
> +
> +	pr_debug("mei: driver [%s] unregistered\n", driver->driver.name);
> +}
> +EXPORT_SYMBOL(mei_driver_unregister);

Same here.

thanks,

greg k-h

  parent reply	other threads:[~2013-02-08 23:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 12:28 [char-misc-next 00/11 V2] Add MEI BUS and NFC Device Tomas Winkler
2013-02-08 12:28 ` [char-misc-next 01/11 V2] mei: bus: Initial MEI bus type implementation Tomas Winkler
2013-02-08 23:53   ` Greg KH
2013-02-10  3:25     ` Samuel Ortiz
2013-02-11 11:50       ` Arnd Bergmann
2013-02-11 13:46         ` Samuel Ortiz
2013-02-11 14:30           ` Greg KH
2013-02-11 15:58             ` Samuel Ortiz
2013-02-11 16:05               ` Greg KH
2013-02-08 12:28 ` [char-misc-next 02/11 V2] mei: bus: Implement driver registration Tomas Winkler
2013-02-08 13:36   ` Arnd Bergmann
2013-02-08 23:55   ` Greg KH [this message]
2013-02-10  3:32     ` Samuel Ortiz
2013-02-10 16:36       ` Greg KH
2013-02-11 11:03         ` Samuel Ortiz
2013-02-08 12:28 ` [char-misc-next 03/11 V2] mei: bus: Initial implementation for I/O routines Tomas Winkler
2013-02-08 12:28 ` [char-misc-next 04/11 V2] mei: bus: Add bus related structures to mei_cl Tomas Winkler
2013-02-08 12:28 ` [char-misc-next 05/11 V2] mei: bus: Call bus routines from the core code Tomas Winkler
2013-02-08 13:34   ` Arnd Bergmann
2013-02-08 12:28 ` [char-misc-next 06/11 V2] mei: bus: Synchronous API for the data transmission Tomas Winkler
2013-02-08 12:28 ` [char-misc-next 07/11 V2] mei: bus: Implement bus driver data setter/getter Tomas Winkler
2013-02-08 12:28 ` [char-misc-next 08/11 V2] mei: nfc: Initial nfc implementation Tomas Winkler
2013-02-08 12:28 ` [char-misc-next 09/11 V2] mei: nfc: Connect also the regular ME client Tomas Winkler
2013-02-08 12:28 ` [char-misc-next 10/11] mei: nfc: Add NFC device to the MEI bus Tomas Winkler
2013-02-08 12:28 ` [char-misc-next 11/11] mei: nfc: Implement MEI bus IO ops Tomas Winkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130208235524.GB24127@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=tomas.winkler@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®