[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vf-EKa9rdpmO54h0rgMcN4TLk8GcYfrjb-2Cy-GRVgEKA@mail.gmail.com>
Date: Wed, 30 Nov 2022 17:50:04 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Tomer Maimon <tmaimon77@...il.com>
Cc: ulf.hansson@...aro.org, avifishman70@...il.com,
tali.perry1@...il.com, joel@....id.au, venture@...gle.com,
yuenn@...gle.com, benjaminfair@...gle.com, adrian.hunter@...el.com,
skhan@...uxfoundation.org, davidgow@...gle.com,
pbrobinson@...il.com, gsomlo@...il.com, briannorris@...omium.org,
arnd@...db.de, krakoczy@...micro.com, openbmc@...ts.ozlabs.org,
linux-mmc@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/2] mmc: sdhci-npcm: Add NPCM SDHCI driver
On Wed, Nov 30, 2022 at 5:09 PM Tomer Maimon <tmaimon77@...il.com> wrote:
>
> Add Nuvoton NPCM BMC sdhci-pltfm controller driver.
...
> obj-$(CONFIG_MMC_S3C) += s3cmci.o
> obj-$(CONFIG_MMC_SDRICOH_CS) += sdricoh_cs.o
> obj-$(CONFIG_MMC_TMIO) += tmio_mmc.o
> +obj-$(CONFIG_MMC_SDHCI_NPCM) += sdhci-npcm.o
Keep it ordered by module name.
> obj-$(CONFIG_MMC_TMIO_CORE) += tmio_mmc_core.o
> obj-$(CONFIG_MMC_SDHI) += renesas_sdhi_core.o
> obj-$(CONFIG_MMC_SDHI_SYS_DMAC) += renesas_sdhi_sys_dmac.o
...
> +/*
> + * NPCM SDHC MMC host controller driver.
> + *
> + */
Too many lines for seems to be oneliner comment.
...
> +#include <linux/of.h>
I don't see how it's being used.
But it seems the mod_devicetable.h is missing.
...
> +static const struct sdhci_pltfm_data npcm_sdhci_pdata = {
> + .quirks = SDHCI_QUIRK_DELAY_AFTER_POWER,
> + .quirks2 = SDHCI_QUIRK2_STOP_WITH_TC |
> + SDHCI_QUIRK2_NO_1_8_V,
> +};
Why? Can't you use the sdhci as a library?
...
> +static int npcm_sdhci_probe(struct platform_device *pdev)
> +{
> + struct sdhci_pltfm_host *pltfm_host;
> + struct sdhci_host *host;
> + u32 caps;
> + int ret;
> +
> + host = sdhci_pltfm_init(pdev, &npcm_sdhci_pdata, 0);
> + if (IS_ERR(host))
> + return PTR_ERR(host);
> +
> + pltfm_host = sdhci_priv(host);
> + pltfm_host->clk = devm_clk_get(&pdev->dev, NULL);
> +
Blank line in a wrong position, should be before devm_clk_get().
> + if (!IS_ERR(pltfm_host->clk))
> + clk_prepare_enable(pltfm_host->clk);
Why not use a specific helper that gets the clock enabled?
> + caps = sdhci_readl(host, SDHCI_CAPABILITIES);
> + if (caps & SDHCI_CAN_DO_8BIT)
> + host->mmc->caps |= MMC_CAP_8_BIT_DATA;
> +
> + ret = mmc_of_parse(host->mmc);
> + if (ret)
> + goto err_sdhci_add;
> +
> + ret = sdhci_add_host(host);
> + if (ret)
> + goto err_sdhci_add;
> +
> + return 0;
> +
> +err_sdhci_add:
> + clk_disable_unprepare(pltfm_host->clk);
> + sdhci_pltfm_free(pdev);
> + return ret;
> +}
...
> +
Redundant blank line.
> +module_platform_driver(npcm_sdhci_driver);
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists