Skip to content

Commit b9c6f78

Browse files
Dan Carpentergregkh
authored andcommitted
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: da0cb63 ("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>
1 parent 2d9c644 commit b9c6f78

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/usb/typec/stusb160x.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,8 @@ static int stusb160x_probe(struct i2c_client *client)
730730
}
731731

732732
chip->port = typec_register_port(chip->dev, &chip->capability);
733-
if (!chip->port) {
734-
ret = -ENODEV;
733+
if (IS_ERR(chip->port)) {
734+
ret = PTR_ERR(chip->port);
735735
goto all_reg_disable;
736736
}
737737

0 commit comments

Comments
 (0)