From: Grant Likely <grant.likely@secretlab.ca>
To: avorontsov@ru.mvista.com
Cc: linuxppc-dev@ozlabs.org, devicetree-discuss@ozlabs.org,
linux-embedded@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [RFC] misc/at24: add experimental OF support for the generic eeprom driver
Date: Thu, 8 Oct 2009 09:48:50 -0600 [thread overview]
Message-ID: <fa686aa40910080848r459c47baob73fc70a95a08604@mail.gmail.com> (raw)
In-Reply-To: <20091008151007.GA21328@oksana.dev.rtsoft.ru>
On Thu, Oct 8, 2009 at 9:10 AM, Anton Vorontsov
<avorontsov@ru.mvista.com> wrote:
> On Thu, Oct 08, 2009 at 08:53:46AM -0600, Grant Likely wrote:
> [...]
>> Please don't. =A0It is such a small amount of code,
>
> It's *always* a small amound of code, at a start. Then we get
> floppy disk drivers and the tty layer. ;-)
Holy straw man argument Batman!
But the focus is still on creating pdata. If a translator gets too
big, then sure, split it into a separate file. Until then, there I
see no good reason to do so now.
>
> [...]
>> Driver writers shouldn't have to
>> write anything more than a tiny function to populate pdata from the
>> device tree. =A0Managing that pdata instance needs to be done with
>> common infrastructure (but I don't have a firm idea about how it
>> should look yet). =A0In the mean time I think Wolfram's approach has
>> lower impact.
>
> If I wasn't a PPC/OF guy to some degree, I'd hate PPC/OF people
> for bringing arch-specific details into a generic code... :-P
No, this goes beyond PPC/OF. The real issue is that it is no longer a
safe assumption that pdata will be a static data structure in platform
code. The number of possible data sources is going to get larger, not
smaller. OF is just one. UEFI is another. Translating that data
into pdata will be the problem that comes up over and over again.
However, translation code is still driver specific, so it belongs with
the driver that it translates code for.
So, in my opinion, translation code must:
1. be *tiny* -- should be trivial to add to a driver without impacting
common code
2. live with the driver that it translates data for; ideally in the
same .c file for drivers that are small.
> No matter how small the OF code is, I believe we shouldn't put it
> into the generic code. Take a look at mmc_spi case again, it can be
> easily extended to any arch, because there is no arch-specific stuff,
> but a "get/put" pattern for platform data.
I'm not disagreeing with you that the arch specific stuff should be
logically separated from the generic code. But I don't agree that it
belongs in a separate file. And I also think that the mmc_spi
implementation uses too much code. There must be a better way.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
next prev parent reply other threads:[~2009-10-08 15:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-08 14:04 [RFC] misc/at24: add experimental OF support for the generic eeprom driver Wolfram Sang
2009-10-08 14:33 ` Anton Vorontsov
2009-10-08 14:53 ` Grant Likely
2009-10-08 15:10 ` Anton Vorontsov
2009-10-08 15:48 ` Grant Likely [this message]
2009-10-08 20:27 ` Wolfram Sang
2009-10-09 5:14 ` Wolfram Sang
2009-10-09 5:40 ` Grant Likely
2009-10-09 14:01 ` Nate Case
2009-10-09 16:09 ` Grant Likely
2009-10-09 16:20 ` Wolfram Sang
2009-10-09 13:43 ` Nate Case
2009-10-09 16:12 ` Wolfram Sang
2009-10-09 16:13 ` Grant Likely
2009-10-08 22:20 ` Anton Vorontsov
2009-10-09 6:37 ` Grant Likely
2009-10-08 14:37 ` Grant Likely
2009-10-08 20:48 ` Wolfram Sang
2009-10-08 22:59 ` Grant Likely
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=fa686aa40910080848r459c47baob73fc70a95a08604@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=avorontsov@ru.mvista.com \
--cc=devicetree-discuss@ozlabs.org \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).