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]

 



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?
> 
> Can't move to other address, because these codes check the card present state.
> 
> 
> --
> 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
> 

--
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