summaryrefslogtreecommitdiffstats
path: root/drivers/usb/typec
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2020-10-23 14:40:17 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-28 13:22:19 +0100
commitb9c6f782150c9992308f4474f920586eaaca4cf1 (patch)
treedda61f38c7261e143779bb1c0baa3acbe4ca0e15 /drivers/usb/typec
parent2d9c6442a9c81f4f8dee678d0b3c183173ab1e2d (diff)
downloadlinux-b9c6f782150c9992308f4474f920586eaaca4cf1.tar.gz
linux-b9c6f782150c9992308f4474f920586eaaca4cf1.tar.bz2
linux-b9c6f782150c9992308f4474f920586eaaca4cf1.zip
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. Fixes: da0cb6310094 ("usb: typec: add support for STUSB160x Type-C controller family") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20201023114017.GE18329@kadam Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec')
-rw-r--r--drivers/usb/typec/stusb160x.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
index 7143852ce94d..da7f1957bcb3 100644
--- a/drivers/usb/typec/stusb160x.c
+++ b/drivers/usb/typec/stusb160x.c
@@ -730,8 +730,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;
}