lkml.org 
[lkml]   [2017]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 10/22] mmc: tmio: support IP-builtin card detection logic
> +static int tmio_mmc_get_cd(struct mmc_host *mmc)
> +{
> + struct tmio_mmc_host *host = mmc_priv(mmc);
> + int ret;
> +
> + ret = mmc_gpio_get_cd(mmc);
> + if (ret >= 0)
> + return ret;
> +
> + return !!(sd_ctrl_read16_and_16_as_32(host, CTL_STATUS) &
> + TMIO_STAT_SIGSTATE);
> +}

I wonder if we shouldn't do something like:

if (mmc_can_gpio_cd())
return mmc_gpio_get_cd()
else
return !!(sd_ctrl_read16_and_16_as_32...)

If we have a GPIO CD defined, I think we want the value of
mmc_gpio_get_cd() in all cases. It makes clearer that this is an
'either-or' case and not a fallback mechanism.

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-12-04 16:14    [W:0.223 / U:9.460 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site