All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfc: st95hf: Make spi remove() callback return zero
@ 2021-10-19 20:49 Uwe Kleine-König
  2021-10-20  6:55 ` Krzysztof Kozlowski
  2021-10-20 13:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2021-10-19 20:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: netdev, kernel

If something goes wrong in the remove callback, returning an error code
just results in an error message. The device still disappears.

So don't skip disabling the regulator in st95hf_remove() if resetting
the controller via spi fails. Also don't return an error code which just
results in two error messages.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/nfc/st95hf/core.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index d16cf3ff644e..b23f47936473 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -1226,11 +1226,9 @@ static int st95hf_remove(struct spi_device *nfc_spi_dev)
 				 &reset_cmd,
 				 ST95HF_RESET_CMD_LEN,
 				 ASYNC);
-	if (result) {
+	if (result)
 		dev_err(&spictx->spidev->dev,
 			"ST95HF reset failed in remove() err = %d\n", result);
-		return result;
-	}
 
 	/* wait for 3 ms to complete the controller reset process */
 	usleep_range(3000, 4000);
@@ -1239,7 +1237,7 @@ static int st95hf_remove(struct spi_device *nfc_spi_dev)
 	if (stcontext->st95hf_supply)
 		regulator_disable(stcontext->st95hf_supply);
 
-	return result;
+	return 0;
 }
 
 /* Register as SPI protocol driver */
-- 
2.30.2


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

* Re: [PATCH] nfc: st95hf: Make spi remove() callback return zero
  2021-10-19 20:49 [PATCH] nfc: st95hf: Make spi remove() callback return zero Uwe Kleine-König
@ 2021-10-20  6:55 ` Krzysztof Kozlowski
  2021-10-20  7:05   ` Uwe Kleine-König
  2021-10-20 13:50 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2021-10-20  6:55 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: netdev, kernel

On 19/10/2021 22:49, Uwe Kleine-König wrote:
> If something goes wrong in the remove callback, returning an error code
> just results in an error message. The device still disappears.
> 
> So don't skip disabling the regulator in st95hf_remove() if resetting
> the controller via spi fails. Also don't return an error code which just
> results in two error messages.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/nfc/st95hf/core.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>


Best regards,
Krzysztof

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

* Re: [PATCH] nfc: st95hf: Make spi remove() callback return zero
  2021-10-20  6:55 ` Krzysztof Kozlowski
@ 2021-10-20  7:05   ` Uwe Kleine-König
  2021-10-20  7:09     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2021-10-20  7:05 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: netdev, kernel

[-- Attachment #1: Type: text/plain, Size: 1076 bytes --]

Hello Krzysztof,

On Wed, Oct 20, 2021 at 08:55:51AM +0200, Krzysztof Kozlowski wrote:
> On 19/10/2021 22:49, Uwe Kleine-König wrote:
> > If something goes wrong in the remove callback, returning an error code
> > just results in an error message. The device still disappears.
> > 
> > So don't skip disabling the regulator in st95hf_remove() if resetting
> > the controller via spi fails. Also don't return an error code which just
> > results in two error messages.
> > 
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> >  drivers/nfc/st95hf/core.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Given you're the listed maintainer for NFC, I wonder who will take this
patch? I expected you to take this patch and not "only" give your
Reviewed-by tag.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] nfc: st95hf: Make spi remove() callback return zero
  2021-10-20  7:05   ` Uwe Kleine-König
@ 2021-10-20  7:09     ` Krzysztof Kozlowski
  2021-10-20  9:29       ` Uwe Kleine-König
  0 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2021-10-20  7:09 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: netdev, kernel

On 20/10/2021 09:05, Uwe Kleine-König wrote:
> Hello Krzysztof,
> 
> On Wed, Oct 20, 2021 at 08:55:51AM +0200, Krzysztof Kozlowski wrote:
>> On 19/10/2021 22:49, Uwe Kleine-König wrote:
>>> If something goes wrong in the remove callback, returning an error code
>>> just results in an error message. The device still disappears.
>>>
>>> So don't skip disabling the regulator in st95hf_remove() if resetting
>>> the controller via spi fails. Also don't return an error code which just
>>> results in two error messages.
>>>
>>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>>> ---
>>>  drivers/nfc/st95hf/core.c | 6 ++----
>>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> 
> Given you're the listed maintainer for NFC, I wonder who will take this
> patch? I expected you to take this patch and not "only" give your
> Reviewed-by tag.
> 

Yeah, it's not that obvious. Maybe I should write subsystem/maintainer
guide for NFC...

All NFC patches are taken by netdev folks (David and Jakub) via
patchwork. You did not CC them here, but you CC-ed the netdev, so let's
hope it is enough. You also skipped linux-nfc, so you might need a file:

  $ cat .get_maintainer.conf
  --s

Best regards,
Krzysztof

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

* Re: [PATCH] nfc: st95hf: Make spi remove() callback return zero
  2021-10-20  7:09     ` Krzysztof Kozlowski
@ 2021-10-20  9:29       ` Uwe Kleine-König
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2021-10-20  9:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: netdev, kernel, Jakub Kicinski, David S. Miller

[-- Attachment #1: Type: text/plain, Size: 1883 bytes --]

On Wed, Oct 20, 2021 at 09:09:04AM +0200, Krzysztof Kozlowski wrote:
> On 20/10/2021 09:05, Uwe Kleine-König wrote:
> > Hello Krzysztof,
> > 
> > On Wed, Oct 20, 2021 at 08:55:51AM +0200, Krzysztof Kozlowski wrote:
> >> On 19/10/2021 22:49, Uwe Kleine-König wrote:
> >>> If something goes wrong in the remove callback, returning an error code
> >>> just results in an error message. The device still disappears.
> >>>
> >>> So don't skip disabling the regulator in st95hf_remove() if resetting
> >>> the controller via spi fails. Also don't return an error code which just
> >>> results in two error messages.
> >>>
> >>> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >>> ---
> >>>  drivers/nfc/st95hf/core.c | 6 ++----
> >>>  1 file changed, 2 insertions(+), 4 deletions(-)
> >>
> >> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> > 
> > Given you're the listed maintainer for NFC, I wonder who will take this
> > patch? I expected you to take this patch and not "only" give your
> > Reviewed-by tag.
> > 
> 
> Yeah, it's not that obvious. Maybe I should write subsystem/maintainer
> guide for NFC...
> 
> All NFC patches are taken by netdev folks (David and Jakub) via
> patchwork. You did not CC them here, but you CC-ed the netdev, so let's
> hope it is enough. You also skipped linux-nfc, so you might need a file:
> 
>   $ cat .get_maintainer.conf
>   --s

Ah, I handpicked the recipents from the get_maintainer.pl output. (My
intention was to pick linux-nfc, not netdev. Either I misremember or cut
the wrong line.)

Anyhow, I added David and Jakub to Cc: to maybe increase my chances this
patch is noticed by them.

Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] nfc: st95hf: Make spi remove() callback return zero
  2021-10-19 20:49 [PATCH] nfc: st95hf: Make spi remove() callback return zero Uwe Kleine-König
  2021-10-20  6:55 ` Krzysztof Kozlowski
@ 2021-10-20 13:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-20 13:50 UTC (permalink / raw)
  To: =?utf-8?q?Uwe_Kleine-K=C3=B6nig_=3Cu=2Ekleine-koenig=40pengutronix=2Ede=3E?=
  Cc: krzysztof.kozlowski, netdev, kernel

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 19 Oct 2021 22:49:16 +0200 you wrote:
> If something goes wrong in the remove callback, returning an error code
> just results in an error message. The device still disappears.
> 
> So don't skip disabling the regulator in st95hf_remove() if resetting
> the controller via spi fails. Also don't return an error code which just
> results in two error messages.
> 
> [...]

Here is the summary with links:
  - nfc: st95hf: Make spi remove() callback return zero
    https://git.kernel.org/netdev/net/c/641e3fd1a038

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-10-20 13:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 20:49 [PATCH] nfc: st95hf: Make spi remove() callback return zero Uwe Kleine-König
2021-10-20  6:55 ` Krzysztof Kozlowski
2021-10-20  7:05   ` Uwe Kleine-König
2021-10-20  7:09     ` Krzysztof Kozlowski
2021-10-20  9:29       ` Uwe Kleine-König
2021-10-20 13:50 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.