Re: [PATCH v2 10/22] mmc: tmio: support IP-builtin card detection logic

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

 



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

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux