mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Randy Dunlap <rdunlap@xenotime.net>,
	Dmitry Torokhov <dtor@mail.ru>, Anisse Astier <anisse@astier.eu>,
	Greg Kroah-Hartman <gregkh@suse.de>,
	Magnus Damm <damm@opensource.se>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Paul Mundt <lethal@linux-sh.org>,
	Eric Miao <eric.y.miao@gmail.com>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH 2/2 v2] Driver core: reduce duplicated code
Date: Mon, 21 Jun 2010 14:38:46 -0700	[thread overview]
Message-ID: <20100621213846.GB25511@kroah.com> (raw)
In-Reply-To: <1277129511-2732-1-git-send-email-u.kleine-koenig@pengutronix.de>

On Mon, Jun 21, 2010 at 04:11:44PM +0200, Uwe Kleine-König wrote:
> This makes the two similar functions platform_device_register_simple
> and platform_device_register_data one line inline functions using a new
> generic function platform_device_register_resndata.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> still unsolved is the naming issue, what do you think about
> platform_device_register?

We already have a platform_device_register() function :)

> I marked the new function as __init_or_module in a separate patch to
> make reverting it a bit easier, still I think it should be possible to
> fix the caller if a problem occurs.
> 
> I changed the semantic slightly to only call
> platform_device_add_resources if data != NULL instead of size != 0.  The
> idea is to support wrappers like:
> 
> 	#define add_blablub(id, pdata) \
> 		platform_device_register_resndata(NULL, "blablub", id, \
> 			NULL, 0, pdata, sizeof(struct blablub_platform_data))
> 
> that don't fail if pdata=NULL.  Ditto for res.

That's fine, but why would you want to have a #define for something like
this?  Is it really needed?

Anyway, this version looks fine to me, I'll go apply it.

thanks,

greg k-h

  reply	other threads:[~2010-06-21 21:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-15  8:47 [PATCH 1/2] Driver core: use kmemdup in platform_device_add_resources Uwe Kleine-König
2010-06-15  8:47 ` [PATCH 2/2] Driver core: reduce duplicated code Uwe Kleine-König
2010-06-15  9:05   ` Uwe Kleine-König
2010-06-16 20:53     ` Greg KH
2010-06-18  7:39       ` Uwe Kleine-König
2010-06-21 13:31         ` [PATCH] ACPI dock: move some functions to .init.text Uwe Kleine-König
2010-10-19  7:13           ` [PATCH RESEND] " Uwe Kleine-König
2010-10-19 15:48             ` Greg KH
2010-10-19 18:03               ` Len Brown
2010-06-21 14:11         ` [PATCH 2/2 v2] Driver core: reduce duplicated code Uwe Kleine-König
2010-06-21 21:38           ` Greg KH [this message]
2010-06-22  5:23             ` Uwe Kleine-König
2010-06-28  4:55               ` Eric Miao
2010-06-28  5:16                 ` Uwe Kleine-König
2010-06-28  5:27                   ` Eric Miao
2010-06-21 14:11         ` [PATCH 3/2] Driver core: move platform device creation helpers to .init.text (if MODULE=n) Uwe Kleine-König

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=20100621213846.GB25511@kroah.com \
    --to=greg@kroah.com \
    --cc=anisse@astier.eu \
    --cc=damm@opensource.se \
    --cc=dtor@mail.ru \
    --cc=eric.y.miao@gmail.com \
    --cc=gregkh@suse.de \
    --cc=lethal@linux-sh.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=rjw@sisk.pl \
    --cc=u.kleine-koenig@pengutronix.de \
    /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

Powered by JetHome