Re: [PATCH v11 2/3] memory: Add STM32 Octo Memory Manager driver

Krzysztof Kozlowski
2025-05-13T07:54:54Z

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