* [PATCH] i2c: make i2c_unregister_device() ERR_PTR safe
@ 2019-08-19 20:48 Wolfram Sang
2019-08-29 8:52 ` Geert Uytterhoeven
2019-08-29 18:40 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2019-08-19 20:48 UTC (permalink / raw)
To: linux-i2c; +Cc: linux-renesas-soc, Wolfram Sang
We are moving towards returning ERR_PTRs when i2c_new_*_device() calls
fail. Make sure its counterpart for unregistering handles ERR_PTRs as
well.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/i2c-core-base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 76cb91e064b8..e5ba612ddc1e 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -832,7 +832,7 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
*/
void i2c_unregister_device(struct i2c_client *client)
{
- if (!client)
+ if (IS_ERR_OR_NULL(client))
return;
if (client->dev.of_node) {
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: make i2c_unregister_device() ERR_PTR safe
2019-08-19 20:48 [PATCH] i2c: make i2c_unregister_device() ERR_PTR safe Wolfram Sang
@ 2019-08-29 8:52 ` Geert Uytterhoeven
2019-08-29 18:40 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2019-08-29 8:52 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux I2C, Linux-Renesas
On Mon, Aug 19, 2019 at 10:49 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> We are moving towards returning ERR_PTRs when i2c_new_*_device() calls
> fail. Make sure its counterpart for unregistering handles ERR_PTRs as
> well.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: make i2c_unregister_device() ERR_PTR safe
2019-08-19 20:48 [PATCH] i2c: make i2c_unregister_device() ERR_PTR safe Wolfram Sang
2019-08-29 8:52 ` Geert Uytterhoeven
@ 2019-08-29 18:40 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2019-08-29 18:40 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-i2c, linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 326 bytes --]
On Mon, Aug 19, 2019 at 10:48:25PM +0200, Wolfram Sang wrote:
> We are moving towards returning ERR_PTRs when i2c_new_*_device() calls
> fail. Make sure its counterpart for unregistering handles ERR_PTRs as
> well.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Applied to for-current, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-29 18:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-19 20:48 [PATCH] i2c: make i2c_unregister_device() ERR_PTR safe Wolfram Sang
2019-08-29 8:52 ` Geert Uytterhoeven
2019-08-29 18:40 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).