public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>,
	Linus Walleij <linus.walleij@stericsson.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Stephen Warren <swarren@nvidia.com>,
	Shawn Guo <shawn.guo@freescale.com>,
	Thomas Abraham <thomas.abraham@linaro.org>,
	Dong Aisheng <dong.aisheng@linaro.org>,
	Rajendra Nayak <rajendra.nayak@linaro.org>,
	Haojian Zhuang <haojian.zhuang@marvell.com>
Subject: Re: [PATCH 02/12] pinctrl: basic Nomadik pinctrl interface
Date: Thu, 10 May 2012 15:57:12 +0000	[thread overview]
Message-ID: <201205101557.12902.arnd@arndb.de> (raw)
In-Reply-To: <201205101553.11304.arnd@arndb.de>

On Thursday 10 May 2012, Arnd Bergmann wrote:
> > >
> > > Arnd, what is your preferred design pattern of:
> > >
> > > A) sub-drivers that register one struct platform_driver per
> > >  variant, then calls into a shared core driver, or
> > >
> > > B) a shared core driver registering one platform_driver
> > >  with several struct platform_device_id that then call
> > >  sub-drivers depending on which one is found
> > >
> > > Either way is actually OK for me, but I was thinking if one
> > > is preferred over the other.
> 
> Out of those two, I'd always pick B.
> 
> In cases where the variants are different enough that you want to
> put them into separate files, I'd do
> 
> C) Make the common code one module that just exports symbols but
> registers no platform_driver at all, then put each variant into
> its own module that binds to one ID and calls the exported
> functions from the common module.
> 

Sorry, I guess A and C are actually the same and I just misread the
question.

So I'd use A for things that are different enough to put them
into separate files, and B for things where I'd always build
all variants in the same driver module anyway, e.g. when only
a few parameters are different.

	Arnd

  reply	other threads:[~2012-05-10 15:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-08  9:44 [PATCH 02/12] pinctrl: basic Nomadik pinctrl interface Linus Walleij
2012-05-09 20:34 ` Stephen Warren
2012-05-10 15:10   ` Linus Walleij
2012-05-10 15:12     ` Linus Walleij
2012-05-10 15:53       ` Arnd Bergmann
2012-05-10 15:57         ` Arnd Bergmann [this message]
2012-05-11  7:12   ` Linus Walleij

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=201205101557.12902.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=dong.aisheng@linaro.org \
    --cc=haojian.zhuang@marvell.com \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rajendra.nayak@linaro.org \
    --cc=shawn.guo@freescale.com \
    --cc=swarren@nvidia.com \
    --cc=swarren@wwwdotorg.org \
    --cc=thomas.abraham@linaro.org \
    /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