diff mbox series

[v2,2/2] mmc: sdhci-esdhc-imx: Use device_get_match_data()

Message ID 20210314230824.148969-2-festevam@gmail.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/2] mmc: sdhci-esdhc-imx: Remove non-DT stub | expand

Commit Message

Fabio Estevam March 14, 2021, 11:08 p.m. UTC
The retrieval of driver data can be a bit simplified by using
device_get_match_data(), so switch to it.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v1:
- None

 drivers/mmc/host/sdhci-esdhc-imx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Ulf Hansson March 19, 2021, 2:12 p.m. UTC | #1
On Mon, 15 Mar 2021 at 00:09, Fabio Estevam <festevam@gmail.com> wrote:
>
> The retrieval of driver data can be a bit simplified by using
> device_get_match_data(), so switch to it.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
> Changes since v1:
> - None
>
>  drivers/mmc/host/sdhci-esdhc-imx.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index 2a1fb1cd4433..d309cc620fdc 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1507,8 +1507,6 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
>
>  static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
>  {
> -       const struct of_device_id *of_id =
> -                       of_match_device(imx_esdhc_dt_ids, &pdev->dev);
>         struct sdhci_pltfm_host *pltfm_host;
>         struct sdhci_host *host;
>         struct cqhci_host *cq_host;
> @@ -1524,7 +1522,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
>
>         imx_data = sdhci_pltfm_priv(pltfm_host);
>
> -       imx_data->socdata = of_id->data;
> +       imx_data->socdata = device_get_match_data(&pdev->dev);
>
>         if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS)
>                 cpu_latency_qos_add_request(&imx_data->pm_qos_req, 0);
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 2a1fb1cd4433..d309cc620fdc 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1507,8 +1507,6 @@  sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
 
 static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *of_id =
-			of_match_device(imx_esdhc_dt_ids, &pdev->dev);
 	struct sdhci_pltfm_host *pltfm_host;
 	struct sdhci_host *host;
 	struct cqhci_host *cq_host;
@@ -1524,7 +1522,7 @@  static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
 
 	imx_data = sdhci_pltfm_priv(pltfm_host);
 
-	imx_data->socdata = of_id->data;
+	imx_data->socdata = device_get_match_data(&pdev->dev);
 
 	if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS)
 		cpu_latency_qos_add_request(&imx_data->pm_qos_req, 0);