Commit 685e013b authored by Bean Huo's avatar Bean Huo Committed by Ulf Hansson

mmc: sdhci-of-at91: Use of_device_get_match_data() helper

Only the device data is needed, not the entire struct of_device_id.
Use of_device_get_match_data() instead of open coding of_match_device().
Signed-off-by: default avatarBean Huo <beanhuo@micron.com>
Link: https://lore.kernel.org/r/20220202180648.1252154-5-huobean@gmail.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent dfbaaec9
...@@ -308,17 +308,15 @@ static const struct dev_pm_ops sdhci_at91_dev_pm_ops = { ...@@ -308,17 +308,15 @@ static const struct dev_pm_ops sdhci_at91_dev_pm_ops = {
static int sdhci_at91_probe(struct platform_device *pdev) static int sdhci_at91_probe(struct platform_device *pdev)
{ {
const struct of_device_id *match;
const struct sdhci_at91_soc_data *soc_data; const struct sdhci_at91_soc_data *soc_data;
struct sdhci_host *host; struct sdhci_host *host;
struct sdhci_pltfm_host *pltfm_host; struct sdhci_pltfm_host *pltfm_host;
struct sdhci_at91_priv *priv; struct sdhci_at91_priv *priv;
int ret; int ret;
match = of_match_device(sdhci_at91_dt_match, &pdev->dev); soc_data = of_device_get_match_data(&pdev->dev);
if (!match) if (!soc_data)
return -EINVAL; return -EINVAL;
soc_data = match->data;
host = sdhci_pltfm_init(pdev, soc_data->pdata, sizeof(*priv)); host = sdhci_pltfm_init(pdev, soc_data->pdata, sizeof(*priv));
if (IS_ERR(host)) if (IS_ERR(host))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment