public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>,
	Patrice Chotard <patrice.chotard@foss.st.com>
Cc: 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: Tue, 13 May 2025 09:54:48 +0200	[thread overview]
Message-ID: <cff1ddb5-b438-4287-80cf-3969f7b7b767@kernel.org> (raw)
In-Reply-To: <aB29hOrv0nU73RCn@stanley.mountain>

On 09/05/2025 10:32, Dan Carpenter wrote:
> 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;

For the record I consider this a bug report which still needs addressing
by the authors.

Best regards,
Krzysztof

  reply	other threads:[~2025-05-13  7:54 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
2025-05-13  7:54     ` Krzysztof Kozlowski [this message]
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=cff1ddb5-b438-4287-80cf-3969f7b7b767@kernel.org \
    --to=krzk@kernel.org \
    --cc=alexandre.torgue@foss.st.com \
    --cc=catalin.marinas@arm.com \
    --cc=christophe.kerello@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@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