[PATCH 05/13] sdhci: Add support for card-detection polling

Pierre Ossman drzeus at drzeus.cx
Mon Mar 9 01:11:21 EST 2009


On Wed, 4 Mar 2009 20:49:17 +0300
Anton Vorontsov <avorontsov at ru.mvista.com> wrote:

> On Sat, Feb 21, 2009 at 04:58:21PM +0100, Pierre Ossman wrote:
> > Just modify the if-clause and
> > things will work.
> 
> That would look horrid...
> 
>         if ((!(host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
>                         !(sdhci_readl(host, SDHCI_PRESENT_STATE) &
>                                 SDHCI_CARD_PRESENT)) ||
>                         (host->flags & SDHCI_DEVICE_DEAD)) {
> 

There are worse ones in that code, but I see your point. :)

> > Might want to add a comment also to make it more obvious what the
> > if-clause does.
> 
> Let's try to avoid the if-clause above? How about this:
> 

Looks ok.

> @@ -1096,6 +1099,7 @@ out:
>  static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  {
>  	struct sdhci_host *host;
> +	bool present;
>  	unsigned long flags;
>  
>  	host = mmc_priv(mmc);

Can we use bool in the kernel?

Rgds
-- 
     -- Pierre Ossman

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20090308/84d2b4f2/attachment.pgp>


More information about the Linuxppc-dev mailing list