Re: [PATCH] mmc: mxs-mmc: implement broken-cd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 10, 2012 at 01:04:00PM +0300, Lauri Hintsala wrote:
> >>@@ -187,6 +188,9 @@ static int mxs_mmc_get_cd(struct mmc_host *mmc)
> >>  {
> >>  	struct mxs_mmc_host *host = mmc_priv(mmc);
> >>
> >>+	if (host->broken_cd)
> >>+		return -ENOSYS;
> >>+
> >
> >The .get_cd caller does not check for error.  This change makes no
> >sense to me.
> 
> In our case we don't want to read card detect bit and we have to
> continue MMC probing because card detect pin is routed nowhere.
> 
> Could it be better to return zero instead of error? ENOSYS is used
> to indicate "unreachable card detect" in other drivers (e.g.
> atmel-mci, omap_hsmmc) and I followed them.
> 
I was wrong.  Even the kerneldoc of .get_cd suggests return -ENOSYS
for that case.

> 
> >Instead, the driver needs to set MMC_CAP_NEEDS_POLL in
> >case of "broken-cd".
> 
> MMC_CAP_NEEDS_POLL is always set in mxs-mmc.
> 
Oops, I forgot that.  But this is really something that needs to be
fixed.  Per my understanding, flag MMC_CAP_NEEDS_POLL should only
be set when card-detect is not working.

Also the card-detect in gpio support is missing.

But for this patch:

Acked-by: Shawn Guo <shawn.guo@xxxxxxxxxx>

-- 
Regards,
Shawn
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux