All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Fabio Estevam <festevam@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	Haibo Chen <haibo.chen@nxp.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH] mmc: sdhci-esdhc-imx: Convert the driver to DT-only
Date: Mon, 23 Nov 2020 17:06:44 +0100	[thread overview]
Message-ID: <CAPDyKFoQdpDwVHWAPzrQEGoZnTFY1h6F37Z1fYboBz03ZQYOFg@mail.gmail.com> (raw)
In-Reply-To: <20201117113750.25053-1-festevam@gmail.com>

On Tue, 17 Nov 2020 at 12:38, Fabio Estevam <festevam@gmail.com> wrote:
>
> Since 5.10-rc1 i.MX is a devicetree-only platform, so simplify the code
> by removing the unused non-DT support.
>
> Signed-off-by: Fabio Estevam <festevam@gmail.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-esdhc-imx.c | 91 +-----------------------------
>  1 file changed, 2 insertions(+), 89 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index fce8fa7e6b30..16ed19f47939 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -296,22 +296,6 @@ struct pltfm_imx_data {
>         struct pm_qos_request pm_qos_req;
>  };
>
> -static const struct platform_device_id imx_esdhc_devtype[] = {
> -       {
> -               .name = "sdhci-esdhc-imx25",
> -               .driver_data = (kernel_ulong_t) &esdhc_imx25_data,
> -       }, {
> -               .name = "sdhci-esdhc-imx35",
> -               .driver_data = (kernel_ulong_t) &esdhc_imx35_data,
> -       }, {
> -               .name = "sdhci-esdhc-imx51",
> -               .driver_data = (kernel_ulong_t) &esdhc_imx51_data,
> -       }, {
> -               /* sentinel */
> -       }
> -};
> -MODULE_DEVICE_TABLE(platform, imx_esdhc_devtype);
> -
>  static const struct of_device_id imx_esdhc_dt_ids[] = {
>         { .compatible = "fsl,imx25-esdhc", .data = &esdhc_imx25_data, },
>         { .compatible = "fsl,imx35-esdhc", .data = &esdhc_imx35_data, },
> @@ -1531,72 +1515,6 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
>  }
>  #endif
>
> -static int sdhci_esdhc_imx_probe_nondt(struct platform_device *pdev,
> -                        struct sdhci_host *host,
> -                        struct pltfm_imx_data *imx_data)
> -{
> -       struct esdhc_platform_data *boarddata = &imx_data->boarddata;
> -       int err;
> -
> -       if (!host->mmc->parent->platform_data) {
> -               dev_err(mmc_dev(host->mmc), "no board data!\n");
> -               return -EINVAL;
> -       }
> -
> -       imx_data->boarddata = *((struct esdhc_platform_data *)
> -                               host->mmc->parent->platform_data);
> -       /* write_protect */
> -       if (boarddata->wp_type == ESDHC_WP_GPIO) {
> -               host->mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
> -
> -               err = mmc_gpiod_request_ro(host->mmc, "wp", 0, 0);
> -               if (err) {
> -                       dev_err(mmc_dev(host->mmc),
> -                               "failed to request write-protect gpio!\n");
> -                       return err;
> -               }
> -       }
> -
> -       /* card_detect */
> -       switch (boarddata->cd_type) {
> -       case ESDHC_CD_GPIO:
> -               err = mmc_gpiod_request_cd(host->mmc, "cd", 0, false, 0);
> -               if (err) {
> -                       dev_err(mmc_dev(host->mmc),
> -                               "failed to request card-detect gpio!\n");
> -                       return err;
> -               }
> -               fallthrough;
> -
> -       case ESDHC_CD_CONTROLLER:
> -               /* we have a working card_detect back */
> -               host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
> -               break;
> -
> -       case ESDHC_CD_PERMANENT:
> -               host->mmc->caps |= MMC_CAP_NONREMOVABLE;
> -               break;
> -
> -       case ESDHC_CD_NONE:
> -               break;
> -       }
> -
> -       switch (boarddata->max_bus_width) {
> -       case 8:
> -               host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA;
> -               break;
> -       case 4:
> -               host->mmc->caps |= MMC_CAP_4_BIT_DATA;
> -               break;
> -       case 1:
> -       default:
> -               host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
> -               break;
> -       }
> -
> -       return 0;
> -}
> -
>  static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
>  {
>         const struct of_device_id *of_id =
> @@ -1616,8 +1534,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
>
>         imx_data = sdhci_pltfm_priv(pltfm_host);
>
> -       imx_data->socdata = of_id ? of_id->data : (struct esdhc_soc_data *)
> -                                                 pdev->id_entry->driver_data;
> +       imx_data->socdata = of_id->data;
>
>         if (imx_data->socdata->flags & ESDHC_FLAG_PMQOS)
>                 cpu_latency_qos_add_request(&imx_data->pm_qos_req, 0);
> @@ -1713,10 +1630,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
>                         goto disable_ahb_clk;
>         }
>
> -       if (of_id)
> -               err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data);
> -       else
> -               err = sdhci_esdhc_imx_probe_nondt(pdev, host, imx_data);
> +       err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data);
>         if (err)
>                 goto disable_ahb_clk;
>
> @@ -1929,7 +1843,6 @@ static struct platform_driver sdhci_esdhc_imx_driver = {
>                 .of_match_table = imx_esdhc_dt_ids,
>                 .pm     = &sdhci_esdhc_pmops,
>         },
> -       .id_table       = imx_esdhc_devtype,
>         .probe          = sdhci_esdhc_imx_probe,
>         .remove         = sdhci_esdhc_imx_remove,
>  };
> --
> 2.17.1
>

      parent reply	other threads:[~2020-11-23 16:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17 11:37 [PATCH] mmc: sdhci-esdhc-imx: Convert the driver to DT-only Fabio Estevam
2020-11-17 12:30 ` Bough Chen
2020-11-23 16:06 ` Ulf Hansson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPDyKFoQdpDwVHWAPzrQEGoZnTFY1h6F37Z1fYboBz03ZQYOFg@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=festevam@gmail.com \
    --cc=haibo.chen@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-mmc@vger.kernel.org \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.