public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Primoz Fiser <primoz.fiser@norik.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	upstream@lists.phytec.de
Subject: Re: [PATCH] OPP: ti: Fix ti_opp_supply_probe wrong return values
Date: Thu, 6 Jun 2024 13:35:37 +0200	[thread overview]
Message-ID: <34dd6ccc-2b0f-45a7-a014-a9d924684f9c@norik.com> (raw)
In-Reply-To: <20240606105822.a7giftun56dsnbgc@vireshk-i7>

Hi,

sent new series instead of v2.

Link:
https://lore.kernel.org/linux-pm/20240606113334.396693-2-primoz.fiser@norik.com/

BR,
Primoz

On 6. 06. 24 12:58, Viresh Kumar wrote:
> On 06-06-24, 12:34, Primoz Fiser wrote:
>>> Ah, I forgot about the token that is returned here. I think the driver
>>> should be fixed properly once and for all here.
>>>
>>> The token must be used to clean the module removal part. Else if you
>>> try to insert this module, remove it, insert again, you will get some
>>> errors as the resources aren't cleaned well.
>>>
>>> So either provide a remove() callback to the driver, or use
>>> devm_pm_opp_set_config() here.
>>>
>>
>> So basically, you want v2 with:
>>
>>> diff --git a/drivers/opp/ti-opp-supply.c b/drivers/opp/ti-opp-supply.c
>>> index e3b97cd1fbbf..8a4bcc5fb9dc 100644
>>> --- a/drivers/opp/ti-opp-supply.c
>>> +++ b/drivers/opp/ti-opp-supply.c
>>> @@ -392,7 +392,7 @@ static int ti_opp_supply_probe(struct platform_device *pdev)
>>>                         return ret;
>>>         }
>>>  
>>> -       ret = dev_pm_opp_set_config_regulators(cpu_dev, ti_opp_config_regulators);
>>> +       ret = devm_pm_opp_set_config_regulators(cpu_dev, ti_opp_config_regulators);
>>>         if (ret < 0)
>>>                 _free_optimized_voltages(dev, &opp_data);
>>>  
>>> diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
>>> index dd7c8441af42..a2401878d1d9 100644
>>> --- a/include/linux/pm_opp.h
>>> +++ b/include/linux/pm_opp.h
>>> @@ -654,14 +654,14 @@ static inline int devm_pm_opp_set_clkname(struct device *dev, const char *name)
>>>  }
>>>  
>>>  /* config-regulators helpers */
>>> -static inline int dev_pm_opp_set_config_regulators(struct device *dev,
> 
> Don't remove this, add a new devm_ counterpart.
> 
>>> +static inline int devm_pm_opp_set_config_regulators(struct device *dev,
>>>                                                    config_regulators_t helper)
>>>  {
>>>         struct dev_pm_opp_config config = {
>>>                 .config_regulators = helper,
>>>         };
>>>  
>>> -       return dev_pm_opp_set_config(dev, &config);
>>> +       return devm_pm_opp_set_config(dev, &config);
>>>  }
> 

-- 
Primoz Fiser                    | phone: +386-41-390-545
<tel:+386-41-390-545> |
---------------------------------------------------------|
Norik systems d.o.o.            | https://www.norik.com
<https://www.norik.com>  |
Your embedded software partner  | email: info@norik.com
<mailto:info@norik.com> |
Slovenia, EU                    | phone: +386-41-540-545
<tel:+386-41-540-545> |


  reply	other threads:[~2024-06-06 11:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06  7:01 [PATCH] OPP: ti: Fix ti_opp_supply_probe wrong return values Primoz Fiser
2024-06-06  8:59 ` Viresh Kumar
2024-06-06  9:43   ` Primoz Fiser
2024-06-06  9:48     ` Viresh Kumar
2024-06-06 10:34       ` Primoz Fiser
2024-06-06 10:58         ` Viresh Kumar
2024-06-06 11:35           ` Primoz Fiser [this message]
2024-06-11  5:29 ` Viresh Kumar

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=34dd6ccc-2b0f-45a7-a014-a9d924684f9c@norik.com \
    --to=primoz.fiser@norik.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=sboyd@kernel.org \
    --cc=upstream@lists.phytec.de \
    --cc=viresh.kumar@linaro.org \
    --cc=vireshk@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