usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
Subsystems (3)
PATCH 1/2 usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
The typec_register_port() function doesn't return error pointers, it returns error pointers.
--- drivers/usb/typec/stusb160x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/typec/stusb160x.c +2 -2
@@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client) } chip->port =typec_register_port (chip->dev, &chip->capability); -if (!chip->port) { - ret = -ENODEV ; +if (IS_ERR (chip->port)) { + ret =PTR_ERR (chip->port); goto all_reg_disable; }
Signature · 1 line
2.28.0
PATCH v2 1/2 usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
The typec_register_port() function doesn't return NULL, it returns error pointers.
---
v2: Fix a typo in the commit message. s/return error pointers/return NULL/.
Thanks, Walter!
drivers/usb/typec/stusb160x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/typec/stusb160x.c +2 -2
@@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client) } chip->port =typec_register_port (chip->dev, &chip->capability); -if (!chip->port) { - ret = -ENODEV ; +if (IS_ERR (chip->port)) { + ret =PTR_ERR (chip->port); goto all_reg_disable; }
Signature · 1 line
2.28.0
Quoted 5 lines · Dan Carpenter
The
typec_register_port()function doesn't return NULL, it returns error pointers.Fixes da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")Signed-off-by Dan Carpenter <[email protected]>
Ah, sorry. You had already fixed the commit message.
Quoted 24 lines
---
v2: Fix a typo in the commit message. s/return error pointers/return NULL/.
Thanks, Walter!drivers/usb/typec/stusb160x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/usb/typec/stusb160x.c +2
-2@@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client) } chip->port =typec_register_port (chip->dev, &chip->capability); -if (!chip->port) { - ret = -ENODEV ; +if (IS_ERR (chip->port)) { + ret =PTR_ERR (chip->port); goto all_reg_disable; }Signature · 1 line
2.28.0
thanks,
Signature · 1 line
heikki
Hi Dan,
Thanks for the patch!
Quoted 5 lines · Dan Carpenter
The
typec_register_port()function doesn't return NULL, it returns error pointers.Fixes da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")Signed-off-by Dan Carpenter <[email protected]>
Quoted 23 lines
---
v2: Fix a typo in the commit message. s/return error pointers/return NULL/.
Thanks, Walter!drivers/usb/typec/stusb160x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/usb/typec/stusb160x.c +2
-2@@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client) } chip->port =typec_register_port (chip->dev, &chip->capability); -if (!chip->port) { - ret = -ENODEV ; +if (IS_ERR (chip->port)) { + ret =PTR_ERR (chip->port); goto all_reg_disable; }
Hello!
Quoted 1 line · Dan Carpenter
The
typec_register_port()function doesn't return error pointers, it
s/error/NULL/, maybe? :-)
Quoted 13 lines
returns error pointers.
Fixes da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")Signed-off-by Dan Carpenter <[email protected]>--- drivers/usb/typec/stusb160x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/usb/typec/stusb160x.c +0
-0
drivers/usb/typec/stusb160x.c static int stusb160x_probe(struct i2c_client *client) · line 736
Quoted 10 lines
drivers/usb/typec/stusb160x.c +2
-2@@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client) } chip->port =typec_register_port (chip->dev, &chip->capability); -if (!chip->port) { - ret = -ENODEV ; +if (IS_ERR (chip->port)) { + ret =PTR_ERR (chip->port); goto all_reg_disable; }
MBR, Sergei
Quoted 5 lines · Dan Carpenter
The
typec_register_port()function doesn't return error pointers, it returns error pointers.Fixes da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family")Signed-off-by Dan Carpenter <[email protected]>
You do need to fix the commit message like Sergei pointed out. Otherwise, FWIW:
Quoted 21 lines
--- drivers/usb/typec/stusb160x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/usb/typec/stusb160x.c +2
-2@@ -729,8 +729,8 @@ static int stusb160x_probe(struct i2c_client *client) } chip->port =typec_register_port (chip->dev, &chip->capability); -if (!chip->port) { - ret = -ENODEV ; +if (IS_ERR (chip->port)) { + ret =PTR_ERR (chip->port); goto all_reg_disable; }Signature · 1 line
2.28.0
thanks,
Signature · 1 line
heikki