Re: [PATCH 1/2 v2] usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

Thanks for the patch!

On 10/23/20 1:40 PM, Dan Carpenter wrote:
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 <dan.carpenter@xxxxxxxxxx>

Reviewed-by: Amelie Delaunay <amelie.delaunay@xxxxxx>

---
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(-)

diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
index ce0bd7b3ad88..f7369e371dd4 100644
--- a/drivers/usb/typec/stusb160x.c
+++ b/drivers/usb/typec/stusb160x.c
@@ -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;
  	}



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux