[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d5875415-07a6-475c-959a-4703f5d4e559@gmail.com>
Date: Fri, 28 Jun 2024 15:50:22 +0800
From: Shan-Chun Hung <shanchun1218@...il.com>
To: Krzysztof Kozlowski <krzk@...nel.org>, ulf.hansson@...aro.org,
robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
adrian.hunter@...el.com, p.zabel@...gutronix.de, pbrobinson@...il.com,
serghox@...il.com, mcgrof@...nel.org,
prabhakar.mahadev-lad.rj@...renesas.com, forbidden405@...look.com,
tmaimon77@...il.com, andy.shevchenko@...il.com,
linux-arm-kernel@...ts.infradead.org, linux-mmc@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: ychuang3@...oton.com, schung@...oton.com
Subject: Re: [PATCH v2 2/2] mmc: sdhci-of-ma35d1: Add Nuvoton MA35D1 SDHCI
driver
Dear Krzysztof,
Thanks for your review.
On 2024/6/28 下午 03:31, Krzysztof Kozlowski wrote:
> On 26/06/2024 11:49, Shan-Chun Hung wrote:
>> Add the SDHCI driver for the MA35D1 platform. It is based upon the
>> SDHCI interface, but requires some extra initialization.
>>
>
>> +static int ma35_probe(struct platform_device *pdev)
>> +{
>> + struct device *dev = &pdev->dev;
>> + struct sdhci_pltfm_host *pltfm_host;
>> + struct sdhci_host *host;
>> + struct ma35_priv *priv;
>> + int err;
>> + u32 extra, ctl;
>> +
>> + host = sdhci_pltfm_init(pdev, &sdhci_ma35_pdata, sizeof(struct ma35_priv));
>> + if (IS_ERR(host))
>> + return PTR_ERR(host);
>> +
>> + err = devm_add_action_or_reset(dev, ma35_sdhci_pltfm_free, pdev);
>> + if (err)
>> + return dev_err_probe(dev, err, "Failed to register sdhci_pltfm_free action\n");
>> +
>> + /* Extra adma table cnt for cross 128M boundary handling. */
>> + extra = DIV_ROUND_UP_ULL(dma_get_required_mask(dev), SZ_128M);
>> + extra = min(extra, SDHCI_MAX_SEGS);
>> +
>> + host->adma_table_cnt += extra;
>> + pltfm_host = sdhci_priv(host);
>> + priv = sdhci_pltfm_priv(pltfm_host);
>> +
>> + pltfm_host->clk = devm_clk_get_optional_enabled(dev, NULL);
>> + if (IS_ERR(pltfm_host->clk))
>> + return dev_err_probe(dev, IS_ERR(pltfm_host->clk), "failed to get clk\n");
> Ykes, you cannot return IS_ERR.
I will fix it to PTR_ERR.
>> +
>> + err = mmc_of_parse(host->mmc);
>> + if (err)
>> + return err;
>> +
>> + priv->rst = devm_reset_control_get_exclusive(dev, NULL);
>> + if (IS_ERR(priv->rst))
>> + return dev_err_probe(dev, PTR_ERR(priv->rst), "failed to get reset control\n");
>> +
>
> Best regards,
> Krzysztof
Best Regards,
Shan-Chun
Powered by blists - more mailing lists