Best Regards
Jerry Huang


> -----Original Message-----
> From: Jaehoon Chung [mailto:[email protected]]
> Sent: Wednesday, October 31, 2012 12:29 PM
> To: Huang Changming-R66093
> Cc: Girish K S; [email protected]; Anton Vorontsov; Chris Ball
> Subject: Re: [PATCH 2/4 v4] MMC/SD: Add callback function to detect card
> 
> Hi,
> 
> >> *host)
> >>>         if (!host->card || mmc_card_removed(host->card))
> >>>                 return 1;
> >>>
> >>> -       ret = host->bus_ops->alive(host);
> >>> +       if (host->ops->get_cd) {
> >>> +               ret = host->ops->get_cd(host);
> >>> +               if (ret >= 0)
> >>> +                       ret = !ret;
> >>> +       }
> >>> +       if (ret < 0)
> >>> +               ret = host->bus_ops->alive(host);
> >> why should we check for negative here? can move this code into else
> >> path of   if (host->ops->get_cd).
> >>>         if (ret) {
> >
> > I did this comment:
> > If the card is present, 1 will return, if the card is absent, 0 will
> return.
> > If the controller will not support this feature, -ENOSYS will return.
> If checked whether card is absent or not with get_cd(), need to check the
> host->bus_ops->alive?

When get_cd is not supported, need to check it.

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to