[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VeAzgCUiH5Z1pVJ-4X29aCK44q907DRQXX75zS4oEhHHg@mail.gmail.com>
Date: Mon, 5 Dec 2022 12:54:05 +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 v2 2/2] mmc: sdhci-npcm: Add NPCM SDHCI driver
On Mon, Dec 5, 2022 at 10:54 AM Tomer Maimon <tmaimon77@...il.com> wrote:
>
> Add Nuvoton NPCM BMC sdhci-pltfm controller driver.
Thank you for an update, my comments below.
...
> +config MMC_SDHCI_NPCM
> config MMC_SDHCI_IPROC
Perhaps after IPROC?
...
> @@ -97,6 +97,7 @@ obj-$(CONFIG_MMC_SDHCI_MICROCHIP_PIC32) += sdhci-pic32.o
> obj-$(CONFIG_MMC_SDHCI_BRCMSTB) += sdhci-brcmstb.o
> obj-$(CONFIG_MMC_SDHCI_OMAP) += sdhci-omap.o
> obj-$(CONFIG_MMC_SDHCI_SPRD) += sdhci-sprd.o
> +obj-$(CONFIG_MMC_SDHCI_NPCM) += sdhci-npcm.o
Perhaps after IPROC? (There is a group of platform drivers slightly
below than here)
> obj-$(CONFIG_MMC_CQHCI) += cqhci.o
...
> +#include <linux/clk.h>
> +#include <linux/err.h>
> +#include <linux/io.h>
> +#include <linux/mmc/host.h>
> +#include <linux/mmc/mmc.h>
> +#include <linux/module.h>
I guess platform_device.h is missing here.
...
> +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_optional(&pdev->dev, NULL);
You can't mix devm with non-devm in this way.
> + if (IS_ERR(pltfm_host->clk))
> + return PTR_ERR(pltfm_host->clk);
> +
> + ret = clk_prepare_enable(pltfm_host->clk);
> + if (ret)
> + return ret;
> +
> + 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;
Why can't you use sdhci_pltfm_register()?
> + return 0;
> +
> +err_sdhci_add:
> + clk_disable_unprepare(pltfm_host->clk);
> + sdhci_pltfm_free(pdev);
> + return ret;
> +}
Missing ->remove() due to above.
Have you tried to compile as a module and then remove and insert it
several times?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists