Re: [PATCH 2/2] mmc: tegra: use mmc_of_parse to get the support of standard MMC DT bindings

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

 



On 02/20/2013 12:05 AM, Joseph Lo wrote:
> Updating the sdhci-tegra driver to use mmc_of_parse to support standard
> MMC DT bindings. Then we can remove the redundant code that already support

>  static unsigned int tegra_sdhci_get_ro(struct sdhci_host *host)
>  {
> -	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> -	struct sdhci_tegra *tegra_host = pltfm_host->priv;
> -
> -	if (!gpio_is_valid(tegra_host->wp_gpio))
> -		return -1;
> -
> -	return gpio_get_value(tegra_host->wp_gpio);
> +	return mmc_gpio_get_ro(host->mmc);
>  }

It'd be nice if there was a standard version of this function that could
be plugged directly into struct sdhci_ops, so that each individual
driver doesn't have to re-invent this wrapper.

> @@ -220,15 +203,12 @@ static void sdhci_tegra_parse_dt(struct device *dev,
>  					struct sdhci_tegra *tegra_host)
>  {
...
> +	struct sdhci_host *host;
...
> +	host = platform_get_drvdata(to_platform_device(dev));
> +	mmc_of_parse(host->mmc);
>  }

It might be simpler to change the function prototype to simply pass in
the host object too.
--
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