mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Shiyan <shc_work@mail.ru>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2 1/2] Introduce device_platform_driver() macro
Date: Thu, 14 Feb 2013 09:30:55 +0100	[thread overview]
Message-ID: <20130214083055.GJ1906@pengutronix.de> (raw)
In-Reply-To: <1360692537-22260-1-git-send-email-shc_work@mail.ru>

On Tue, Feb 12, 2013 at 10:08:56PM +0400, Alexander Shiyan wrote:
> device_platform_driver() - Helper macro for drivers that don't do
> anything special in module registration. This eliminates a lot of
> boilerplate. Driver registration will called on device_initcall.
> 
> Signed-off-by: Alexander Shiyan <shc_work@mail.ru>

Applied, thanks.

Sascha

> ---
>  include/driver.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/include/driver.h b/include/driver.h
> index 31f5d69..151829e 100644
> --- a/include/driver.h
> +++ b/include/driver.h
> @@ -390,6 +390,18 @@ extern struct list_head bus_list;
>  extern struct bus_type platform_bus;
>  
>  int platform_driver_register(struct driver_d *drv);
> +
> +/* device_platform_driver() - Helper macro for drivers that don't do
> + * anything special in module registration. This eliminates a lot of
> + * boilerplate. Each module may only use this macro once.
> + */
> +#define device_platform_driver(drv)			\
> +	static int __init drv ## _register(void)	\
> +	{						\
> +		return platform_driver_register(&drv);	\
> +	}						\
> +	device_initcall(drv ## _register)
> +
>  int platform_device_register(struct device_d *new_device);
>  
>  struct file_operations {
> -- 
> 1.7.12.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2013-02-14  8:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-12 18:08 Alexander Shiyan
2013-02-12 18:08 ` [PATCH v2 2/2] Use new device_platform_driver() macro for drivers Alexander Shiyan
2013-02-14  8:30 ` Sascha Hauer [this message]

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=20130214083055.GJ1906@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=shc_work@mail.ru \
    /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