mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] pinctrl: qcom: lpass-lpi: drop unused runtime-PM write helper
@ 2026-06-10  8:08 Ajay Kumar Nandam
  2026-06-10  8:25 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Ajay Kumar Nandam @ 2026-06-10  8:08 UTC (permalink / raw)
  To: Bjorn Andersson, Linus Walleij, Ajay Kumar Nandam
  Cc: linux-arm-msm, linux-gpio, linux-kernel

lpi_gpio_write() became unused after the PM clock runtime conversion
switched write paths to __lpi_gpio_write() inside callers that already
hold an active runtime-PM reference.

With -Werror this triggers:
  error: 'lpi_gpio_write' defined but not used [-Wunused-function]

Remove the dead wrapper.

Fixes: b719ede389d8 ("pinctrl: qcom: lpass-lpi: Switch to PM clock framework for runtime PM")
Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
---
 drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
index 4d758fd117c4..fe7ec0176081 100644
--- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
+++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
@@ -79,20 +79,6 @@ static int lpi_gpio_read(struct lpi_pinctrl *state, unsigned int pin,
 	return pm_runtime_put_autosuspend(state->dev);
 }
 
-static int lpi_gpio_write(struct lpi_pinctrl *state, unsigned int pin,
-			  unsigned int addr, unsigned int val)
-{
-	int ret;
-
-	ret = pm_runtime_resume_and_get(state->dev);
-	if (ret < 0)
-		return ret;
-
-	__lpi_gpio_write(state, pin, addr, val);
-
-	return pm_runtime_put_autosuspend(state->dev);
-}
-
 static const struct pinctrl_ops lpi_gpio_pinctrl_ops = {
 	.get_groups_count	= pinctrl_generic_get_group_count,
 	.get_group_name		= pinctrl_generic_get_group_name,
-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] pinctrl: qcom: lpass-lpi: drop unused runtime-PM write helper
  2026-06-10  8:08 [PATCH v1] pinctrl: qcom: lpass-lpi: drop unused runtime-PM write helper Ajay Kumar Nandam
@ 2026-06-10  8:25 ` Krzysztof Kozlowski
  2026-06-10  8:57   ` Ajay Kumar Nandam
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2026-06-10  8:25 UTC (permalink / raw)
  To: Ajay Kumar Nandam, Bjorn Andersson, Linus Walleij
  Cc: linux-arm-msm, linux-gpio, linux-kernel

On 10/06/2026 10:08, Ajay Kumar Nandam wrote:
> lpi_gpio_write() became unused after the PM clock runtime conversion
> switched write paths to __lpi_gpio_write() inside callers that already
> hold an active runtime-PM reference.
> 
> With -Werror this triggers:
>   error: 'lpi_gpio_write' defined but not used [-Wunused-function]
> 
> Remove the dead wrapper.
> 
> Fixes: b719ede389d8 ("pinctrl: qcom: lpass-lpi: Switch to PM clock framework for runtime PM")

Please add Reported-by credits, at least Nathan as he bisected it.


> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
> ---
>  drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 14 --------------
>  1 file changed, 14 deletions(-)
> 
> diff --git a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
> index 4d758fd117c4..fe7ec0176081 100644
> --- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
> +++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
> @@ -79,20 +79,6 @@ static int lpi_gpio_read(struct lpi_pinctrl *state, unsigned int pin,
>  	return pm_runtime_put_autosuspend(state->dev);
>  }
>  
> -static int lpi_gpio_write(struct lpi_pinctrl *state, unsigned int pin,
> -			  unsigned int addr, unsigned int val)

So why do we need __lpi_gpio_write()?

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] pinctrl: qcom: lpass-lpi: drop unused runtime-PM write helper
  2026-06-10  8:25 ` Krzysztof Kozlowski
@ 2026-06-10  8:57   ` Ajay Kumar Nandam
  2026-06-10  9:00     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Ajay Kumar Nandam @ 2026-06-10  8:57 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Bjorn Andersson, Linus Walleij
  Cc: linux-arm-msm, linux-gpio, linux-kernel



On 6/10/2026 1:55 PM, Krzysztof Kozlowski wrote:
> On 10/06/2026 10:08, Ajay Kumar Nandam wrote:
>> lpi_gpio_write() became unused after the PM clock runtime conversion
>> switched write paths to __lpi_gpio_write() inside callers that already
>> hold an active runtime-PM reference.
>>
>> With -Werror this triggers:
>>    error: 'lpi_gpio_write' defined but not used [-Wunused-function]
>>
>> Remove the dead wrapper.
>>
>> Fixes: b719ede389d8 ("pinctrl: qcom: lpass-lpi: Switch to PM clock framework for runtime PM")
> 
> Please add Reported-by credits, at least Nathan as he bisected it.
> 
> 
>> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
>> ---
>>   drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 14 --------------
>>   1 file changed, 14 deletions(-)
>>
>> diff --git a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
>> index 4d758fd117c4..fe7ec0176081 100644
>> --- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
>> +++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.c
>> @@ -79,20 +79,6 @@ static int lpi_gpio_read(struct lpi_pinctrl *state, unsigned int pin,
>>   	return pm_runtime_put_autosuspend(state->dev);
>>   }
>>   
>> -static int lpi_gpio_write(struct lpi_pinctrl *state, unsigned int pin,
>> -			  unsigned int addr, unsigned int val)
> 
> So why do we need __lpi_gpio_write()?

Hi Krzysztof,

Thanks, good point.

I will respin with:
Reported-by: Nathan Chancellor <nathan@kernel.org>

About __lpi_gpio_write(): it is still needed for the in-callers path 
where runtime PM is already held and we only need the raw MMIO helper. 
The unused wrapper is lpi_gpio_write(), so this fix removes only that 
dead function.

Thanks,
Ajay


> 
> Best regards,
> Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] pinctrl: qcom: lpass-lpi: drop unused runtime-PM write helper
  2026-06-10  8:57   ` Ajay Kumar Nandam
@ 2026-06-10  9:00     ` Krzysztof Kozlowski
  2026-06-10  9:14       ` Ajay Kumar Nandam
  2026-06-10 18:11       ` Ajay Kumar Nandam
  0 siblings, 2 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2026-06-10  9:00 UTC (permalink / raw)
  To: Ajay Kumar Nandam, Bjorn Andersson, Linus Walleij
  Cc: linux-arm-msm, linux-gpio, linux-kernel

On 10/06/2026 10:57, Ajay Kumar Nandam wrote:
>> So why do we need __lpi_gpio_write()?
> 
> Hi Krzysztof,
> 
> Thanks, good point.
> 
> I will respin with:
> Reported-by: Nathan Chancellor <nathan@kernel.org>


And checkpatch.

> 
> About __lpi_gpio_write(): it is still needed for the in-callers path 
> where runtime PM is already held and we only need the raw MMIO helper. 
> The unused wrapper is lpi_gpio_write(), so this fix removes only that 
> dead function.

No. Why did you have to add __ prefix? Why do we need function named
with such style?

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] pinctrl: qcom: lpass-lpi: drop unused runtime-PM write helper
  2026-06-10  9:00     ` Krzysztof Kozlowski
@ 2026-06-10  9:14       ` Ajay Kumar Nandam
  2026-06-10 18:11       ` Ajay Kumar Nandam
  1 sibling, 0 replies; 6+ messages in thread
From: Ajay Kumar Nandam @ 2026-06-10  9:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Bjorn Andersson, Linus Walleij
  Cc: linux-arm-msm, linux-gpio, linux-kernel



On 6/10/2026 2:30 PM, Krzysztof Kozlowski wrote:
> On 10/06/2026 10:57, Ajay Kumar Nandam wrote:
>>> So why do we need __lpi_gpio_write()?
>>
>> Hi Krzysztof,
>>
>> Thanks, good point.
>>
>> I will respin with:
>> Reported-by: Nathan Chancellor <nathan@kernel.org>
> 
> 
> And checkpatch.
> 
>>
>> About __lpi_gpio_write(): it is still needed for the in-callers path
>> where runtime PM is already held and we only need the raw MMIO helper.
>> The unused wrapper is lpi_gpio_write(), so this fix removes only that
>> dead function.
> 
> No. Why did you have to add __ prefix? Why do we need function named
> with such style?

Hi Krzysztof,

The __ prefix was introduced during refactoring to distinguish the raw 
MMIO helper from lpi_gpio_write(). After the wrapper became unused and 
was removed, the naming is less clear.

Do you recommend renaming these helpers to regular/raw names (without 
__) while keeping behavior unchanged?

Thanks,
Ajay


> 
> Best regards,
> Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v1] pinctrl: qcom: lpass-lpi: drop unused runtime-PM write helper
  2026-06-10  9:00     ` Krzysztof Kozlowski
  2026-06-10  9:14       ` Ajay Kumar Nandam
@ 2026-06-10 18:11       ` Ajay Kumar Nandam
  1 sibling, 0 replies; 6+ messages in thread
From: Ajay Kumar Nandam @ 2026-06-10 18:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Bjorn Andersson, Linus Walleij
  Cc: linux-arm-msm, linux-gpio, linux-kernel



On 6/10/2026 2:30 PM, Krzysztof Kozlowski wrote:
> On 10/06/2026 10:57, Ajay Kumar Nandam wrote:
>>> So why do we need __lpi_gpio_write()?
>>
>> Hi Krzysztof,
>>
>> Thanks, good point.
>>
>> I will respin with:
>> Reported-by: Nathan Chancellor <nathan@kernel.org>
> 
> 
> And checkpatch.
> 
>>
>> About __lpi_gpio_write(): it is still needed for the in-callers path
>> where runtime PM is already held and we only need the raw MMIO helper.
>> The unused wrapper is lpi_gpio_write(), so this fix removes only that
>> dead function.
> 
> No. Why did you have to add __ prefix? Why do we need function named
> with such style?

I’ve posted v2 addressing this:
https://lore.kernel.org/all/20260610180012.3505877-1-ajay.nandam@oss.qualcomm.com/

In v2 I removed the unused wrapper, renamed the internal helpers from 
__lpi_gpio_* to lpi_gpio_*_reg (no functional change)

Thanks
Ajay kumar Nandam

> 
> Best regards,
> Krzysztof


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-10 18:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-10  8:08 [PATCH v1] pinctrl: qcom: lpass-lpi: drop unused runtime-PM write helper Ajay Kumar Nandam
2026-06-10  8:25 ` Krzysztof Kozlowski
2026-06-10  8:57   ` Ajay Kumar Nandam
2026-06-10  9:00     ` Krzysztof Kozlowski
2026-06-10  9:14       ` Ajay Kumar Nandam
2026-06-10 18:11       ` Ajay Kumar Nandam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®