From: Dan Carpenter <dan.carpenter@linaro.org>
To: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Krzysztof Kozlowski <krzk@kernel.org>,
Rob Herring <robh@kernel.org>, Conor Dooley <conor+dt@kernel.org>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
christophe.kerello@foss.st.com, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v11 2/3] memory: Add STM32 Octo Memory Manager driver
Date: Fri, 9 May 2025 11:32:04 +0300 [thread overview]
Message-ID: <aB29hOrv0nU73RCn@stanley.mountain> (raw)
In-Reply-To: <20250428-upstream_ospi_v6-v11-2-1548736fd9d2@foss.st.com>
On Mon, Apr 28, 2025 at 10:58:31AM +0200, Patrice Chotard wrote:
> +static int stm32_omm_toggle_child_clock(struct device *dev, bool enable)
> +{
> + struct stm32_omm *omm = dev_get_drvdata(dev);
> + int i, ret;
> +
> + for (i = 0; i < omm->nb_child; i++) {
> + if (enable) {
> + ret = clk_prepare_enable(omm->clk_bulk[i + 1].clk);
> + if (ret) {
> + dev_err(dev, "Can not enable clock\n");
> + goto clk_error;
> + }
> + } else {
> + clk_disable_unprepare(omm->clk_bulk[i + 1].clk);
> + }
> + }
> +
> + return 0;
> +
> +clk_error:
> + while (i--)
> + clk_disable_unprepare(omm->clk_bulk[i + 1].clk);
> +
> + return ret;
> +}
> +
> +static int stm32_omm_disable_child(struct device *dev)
> +{
> + struct stm32_omm *omm = dev_get_drvdata(dev);
> + struct reset_control *reset;
> + int ret;
> + u8 i;
> +
> + ret = stm32_omm_toggle_child_clock(dev, true);
> + if (!ret)
^^^^
I'm pretty sure this was intended to be if (ret) and the ! is a typo.
> + return ret;
If it's not a typo please write this as:
if (!ret)
return 0;
regards,
dan carpenter
> +
> + for (i = 0; i < omm->nb_child; i++) {
> + /* reset OSPI to ensure CR_EN bit is set to 0 */
> + reset = omm->child_reset[i];
> + ret = reset_control_acquire(reset);
> + if (ret) {
> + stm32_omm_toggle_child_clock(dev, false);
> + dev_err(dev, "Can not acquire resset %d\n", ret);
> + return ret;
> + }
> +
> + reset_control_assert(reset);
> + udelay(2);
> + reset_control_deassert(reset);
> +
> + reset_control_release(reset);
> + }
> +
> + return stm32_omm_toggle_child_clock(dev, false);
> +}
next prev parent reply other threads:[~2025-05-09 9:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 8:58 [PATCH v11 0/3] Add STM32MP25 SPI NOR support Patrice Chotard
2025-04-28 8:58 ` [PATCH v11 1/3] dt-bindings: memory-controllers: Add STM32 Octo Memory Manager controller Patrice Chotard
2025-04-28 8:58 ` [PATCH v11 2/3] memory: Add STM32 Octo Memory Manager driver Patrice Chotard
2025-05-09 8:32 ` Dan Carpenter [this message]
2025-05-13 7:54 ` Krzysztof Kozlowski
2025-05-13 15:22 ` Patrice CHOTARD
2025-04-28 8:58 ` [PATCH v11 3/3] MAINTAINERS: add entry for STM32 OCTO MEMORY MANAGER driver Patrice Chotard
2025-05-04 13:50 ` [PATCH v11 0/3] Add STM32MP25 SPI NOR support Krzysztof Kozlowski
2025-05-04 16:16 ` Krzysztof Kozlowski
2025-05-05 12:15 ` Patrice CHOTARD
2025-05-05 12:51 ` Krzysztof Kozlowski
2025-05-07 9:40 ` Krzysztof Kozlowski
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=aB29hOrv0nU73RCn@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=alexandre.torgue@foss.st.com \
--cc=catalin.marinas@arm.com \
--cc=christophe.kerello@foss.st.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=patrice.chotard@foss.st.com \
--cc=robh@kernel.org \
--cc=will@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 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).