Re: [PATCH 3/4] [MMC] mmc_spi: add polling support for the carddetect line

From: Pierre Ossman
Date: Thu May 22 2008 - 15:35:38 EST


On Thu, 22 May 2008 22:17:13 +0400
Anton Vorontsov <avorontsov@xxxxxxxxxxxxx> wrote:

> On Wed, May 21, 2008 at 09:28:31PM +0200, Pierre Ossman wrote:
> >
> > Fair enough. You should probably add a comment about this somewhere so
> > that people do not call get_cd() in the core request function and
> > similar places. Place it so that both get_cd() and get_ro() are covered
> > though, as it should be relevant for both.
>
> I think this is applicable to the .set_ios() too.
>

Indeed. That tends to be more obvious that it is costly though.

> >
> > This can be solved by allowing get_cd() to return an error that will be
> > treated as if get_cd() wasn't defined. -ENODEV seems suitable.
>
> -ENOSYS (not implemented) sounds better for this purpose...
>

Even better. :)

> > (get_ro() needs the same treatment, but I haven't gotten around to
> > that)
>
> Ok. How about this version?
>

Perfect. Unless there is some way you can pass flags in platform data?
Using the lack of an init() to determine the need for polling is a bit
circumstantial.

Rgds
--
-- Pierre Ossman

Linux kernel, MMC maintainer http://www.kernel.org
rdesktop, core developer http://www.rdesktop.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/