[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171204151320.4ypa2y5r335hcg7j@ninjato>
Date: Mon, 4 Dec 2017 16:13:21 +0100
From: Wolfram Sang <wsa@...-dreams.de>
To: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: linux-mmc@...r.kernel.org,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Simon Horman <simon.horman@...ronome.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
Ulf Hansson <ulf.hansson@...aro.org>
Subject: Re: [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.
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists