mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre Ossman <drzeus-mmc@drzeus.cx>
To: avorontsov@ru.mvista.com
Cc: David Brownell <dbrownell@users.sourceforge.net>,
	Grant Likely <grant.likely@secretlab.ca>,
	Gary Jennejohn <garyj@denx.de>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/2] mmc_spi: export probe and remove functions
Date: Thu, 5 Jun 2008 23:16:04 +0200	[thread overview]
Message-ID: <20080605231604.08cd04ca@mjolnir.drzeus.cx> (raw)
In-Reply-To: <20080602125337.GA2872@polina.dev.rtsoft.ru>

On Mon, 2 Jun 2008 16:53:37 +0400
Anton Vorontsov <avorontsov@ru.mvista.com> wrote:

> On Sun, Jun 01, 2008 at 12:18:41PM +0200, Pierre Ossman wrote:
> > On Mon, 26 May 2008 17:10:09 +0400
> > Anton Vorontsov <avorontsov@ru.mvista.com> wrote:
> > 
> > > 
> > > Btw, this isn't actually drivers encapsulating. This is about making
> > > mmc_spi export some "library" function which could be used by other
> > > bindings.
> > > 
> > > Think of usb_add_hcd() used by various drivers' bindings for e.g.
> > > drivers/usb/host/ehci-*.c. Though usb_add_hcd() is more generic
> > > than just "EHCI" bindings, but only because there is nothing to
> > > share between them. (for MMC over SPI bindings all we want to do is fill
> > > the platform data).
> > > 
> > 
> > There's a big difference.
> 
> This depends on the perception. :-)
> 
> > usb_add_hcd() is designed specifically to be called by other, real probe
> > functions.
> 
> Yes, by convention (or better, by design).
> 
> > mmc_spi_probe() _is_ a probe function. 
> 
> Yes, so far.
> 
> > Also exporting it as a library function is very confusing.
> 
> No, if designed/documented properly.
> 
> Just imagine this (100% similarity to USB code):
> 
> mmc_spi_create_hcd(&mmc_spi_driver, dev, dev->bus_id);
> mmc_spi_add_hcd(dev, irq, irqflags);
> 

I'm not necessarily against that idea. What I don't like is using a
function for different things. So you'd need to restructure things a
bit, and not just export the probe function.

> > 
> > From what I can tell, the OF stuff behaves very much like the PNP
> > system on PCs. The information relayed is a bit more versatile though.
> > Perhaps what is needed is a more advanced "platform" bus that is
> > modeled after the PNP bus, but with the extra ability of handling the
> > stuff currently crammed into the platform structures. mmc_spi would
> > then be extended to be driver for the "platform" bus and we could have
> > generic calls like platform_get_pin(dev, "ro");.
> 
> platform_get_pin()? Um, maybe platform_get_gpio(), as _irq()? Yes,
> this is doable (and someday this should be done). But this way we can
> pass only GPIOs and then teach mmc_spi to work with them directly
> (in addition to callbacks).
> 
> But this is not enough, there is still no way to pass real platform data,
> such as: caps and ocr_mask. Any idea how to deliver these?
> 

platform_get_attr("ocr") perhaps? I'm afraid I have not dealt enough
with the embedded parts of the kernel to give a complete suggestion as
to how this might be solved.

My concern is building something OF specific right now, only to have to
restructure things when the next firmware interface shows up and having
to deal with all the fallout caused by API changes.

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  rdesktop, core developer          http://www.rdesktop.org

  reply	other threads:[~2008-06-05 21:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-23 18:27 [RFC] OpenFirmware bindings for the MMC-over-SPI driver Anton Vorontsov
2008-05-23 18:28 ` [RFC PATCH 1/2] mmc_spi: export probe and remove functions Anton Vorontsov
2008-05-26 12:18   ` Pierre Ossman
2008-05-26 12:25     ` Anton Vorontsov
2008-05-26 13:10       ` Anton Vorontsov
2008-06-01 10:18         ` Pierre Ossman
2008-06-02 12:53           ` Anton Vorontsov
2008-06-05 21:16             ` Pierre Ossman [this message]
2008-05-23 18:28 ` [RFC PATCH 2/2] mmc: add OpenFirmware bindings for the mmc_spi driver Anton Vorontsov
2008-05-24  2:35   ` Stephen Rothwell
2008-05-26 11:58     ` Anton Vorontsov
2008-05-24  5:19   ` Grant Likely
2008-05-24 14:32     ` Jochen Friedrich
2008-05-24 23:14       ` Segher Boessenkool
2008-05-24 23:06     ` Segher Boessenkool
2008-05-26 11:49     ` Anton Vorontsov
2008-05-26 22:19       ` David Brownell
2008-05-26 23:15         ` Anton Vorontsov
2008-05-24 19:56 ` [RFC] OpenFirmware bindings for the MMC-over-SPI driver David Brownell
2008-05-25  4:47   ` 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=20080605231604.08cd04ca@mjolnir.drzeus.cx \
    --to=drzeus-mmc@drzeus.cx \
    --cc=avorontsov@ru.mvista.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=g.liakhovetski@gmx.de \
    --cc=garyj@denx.de \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®