linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: zhangfei gao <zhangfei.gao@gmail.com>
Cc: Philip Rakity <prakity@marvell.com>,
	Wolfram Sang <w.sang@pengutronix.de>, Chris Ball <cjb@laptop.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Jun Nie <njun@marvell.com>, Raymond Wu <xywu@marvell.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Mark Brown <mark.brown314@gmail.com>,
	Shawn Guo <shawn.guo@linaro.org>
Subject: Re: [PATCH 2/2] sdhci-pxa: add call back interface to share sdhci-pxa
Date: Thu, 19 May 2011 15:04:49 +0200	[thread overview]
Message-ID: <201105191504.49875.arnd@arndb.de> (raw)
In-Reply-To: <BANLkTinGQLPD4LmjiSjtswqJ19xtvimjUw@mail.gmail.com>

On Thursday 19 May 2011, zhangfei gao wrote:
> To make sdhci-pxa easy to maintain, we still prefer put platform
> specific difference under platform code.
> 
> "Identify controller from platform data" looks to me is same as using #ifdef.
> The method is used in our another driver before.

I meant run-time code, not compile-time #ifdef. In the long run, we
want to have a kernel that is able to work on many different systems,
and that means the drivers should not impose hardcoded limitations.

> More and more workaround comes when more and more platform need to
> support, making the driver bigger and bigger and not easy to maintain.
> Nobody remember what's the workaround purpose several years later.
> So the result is we have to re-write the driver again to make it simple :(
> 
> Currently, the ip is shared among mmp2, pxa910, pxa168 etc, pxa910
> maintainer does not care what workaround is used on pxa168.
> When mmp3 wants to reuse the ip, it's easier to not care what's the
> history at all.
> 
> So we still prefer keep driver as simple as possible, while specific
> platform self-maintain specific workaround , which is not aware to
> other platform.

There are a lot of different ways to do the same thing, but splitting
out code into the subarchitecture is not a good one. Please have a look
at how Shawn Guo has reworked the sdhci-pltfm drivers to have common
part as a library and then multiple users of that. You can probably
do the same with the different versions of the sdhci-pxa driver.

	Arnd

  reply	other threads:[~2011-05-19 13:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-29  3:57 [PATCH 2/2] sdhci-pxa: add call back interface to share sdhci-pxa zhangfei gao
2011-05-12 22:25 ` Chris Ball
2011-05-12 22:58   ` Philip Rakity
2011-05-13 13:47     ` Chris Ball
2011-05-14  5:11       ` zhangfei gao
2011-05-14 17:01         ` Philip Rakity
2011-05-15 21:32           ` Philip Rakity
2011-05-16  6:26           ` zhangfei gao
2011-05-16 13:51             ` Philip Rakity
2011-05-17  2:02               ` zhangfei gao
2011-05-17  4:27                 ` Philip Rakity
2011-05-17  5:39                   ` zhangfei gao
2011-05-18 20:38                     ` Arnd Bergmann
2011-05-19 11:34                       ` zhangfei gao
2011-05-19 13:04                         ` Arnd Bergmann [this message]
2011-05-23 13:13                           ` zhangfei gao
2011-05-23 14:56                             ` Arnd Bergmann
2011-05-19 18:24                         ` Nicolas Pitre
2011-05-21  1:50                           ` zhangfei gao
  -- strict thread matches above, loose matches on Subject: below --
2010-12-03  6:31 [PATCH 2/2] sdhci-pxa " zhangfei gao
2010-12-07  5:56 ` Raymond Wu
2010-12-07 15:26   ` Philip Rakity
2010-12-07 15:38     ` zhangfei gao
2010-12-07 15:48       ` Philip Rakity
2010-12-07 15:58         ` zhangfei gao
2010-12-27  7:09 ` zhangfei gao

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=201105191504.49875.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=cjb@laptop.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=mark.brown314@gmail.com \
    --cc=njun@marvell.com \
    --cc=prakity@marvell.com \
    --cc=shawn.guo@linaro.org \
    --cc=w.sang@pengutronix.de \
    --cc=xywu@marvell.com \
    --cc=zhangfei.gao@gmail.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;
as well as URLs for NNTP newsgroup(s).