From: Krzysztof Kozlowski <krzk@kernel.org>
To: Shan-Chun Hung <shanchun1218@gmail.com>,
ulf.hansson@linaro.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, adrian.hunter@intel.com,
p.zabel@pengutronix.de, pbrobinson@gmail.com, serghox@gmail.com,
mcgrof@kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com,
forbidden405@outlook.com, tmaimon77@gmail.com,
andy.shevchenko@gmail.com, linux-arm-kernel@lists.infradead.org,
linux-mmc@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: ychuang3@nuvoton.com, schung@nuvoton.com
Subject: Re: [PATCH v2 2/2] mmc: sdhci-of-ma35d1: Add Nuvoton MA35D1 SDHCI driver
Date: Fri, 28 Jun 2024 09:31:01 +0200 [thread overview]
Message-ID: <0cc0aab1-f7bf-4a87-af5a-22cf842fbf80@kernel.org> (raw)
In-Reply-To: <20240626094900.581552-3-shanchun1218@gmail.com>
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.
> +
> + 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
next prev parent reply other threads:[~2024-06-28 7:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 9:48 [PATCH v2 0/2] Add support for Nuvoton MA35D1 SDHCI Shan-Chun Hung
2024-06-26 9:48 ` [PATCH v2 1/2] dt-bindings: mmc: nuvoton,ma35d1-sdhci: Document MA35D1 SDHCI controller Shan-Chun Hung
2024-06-28 7:29 ` Krzysztof Kozlowski
2024-06-26 9:49 ` [PATCH v2 2/2] mmc: sdhci-of-ma35d1: Add Nuvoton MA35D1 SDHCI driver Shan-Chun Hung
2024-06-27 9:40 ` Adrian Hunter
2024-06-28 6:30 ` Shan-Chun Hung
2024-06-28 6:59 ` Adrian Hunter
2024-06-28 7:17 ` Shan-Chun Hung
2024-06-28 7:31 ` Krzysztof Kozlowski [this message]
2024-06-28 7:50 ` Shan-Chun Hung
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=0cc0aab1-f7bf-4a87-af5a-22cf842fbf80@kernel.org \
--to=krzk@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=forbidden405@outlook.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pbrobinson@gmail.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=robh@kernel.org \
--cc=schung@nuvoton.com \
--cc=serghox@gmail.com \
--cc=shanchun1218@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=ychuang3@nuvoton.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).