RE: [PATCH 2/4 v4] MMC/SD: Add callback function to detect card

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

 




Best Regards
Jerry Huang


> -----Original Message-----
> From: Jaehoon Chung [mailto:jh80.chung@xxxxxxxxxxx]
> Sent: Wednesday, October 31, 2012 12:29 PM
> To: Huang Changming-R66093
> Cc: Girish K S; linux-mmc@xxxxxxxxxxxxxxx; 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 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