forked from Minki/linux
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: da0cb63100
("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>
This commit is contained in:
parent
2d9c6442a9
commit
b9c6f78215
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user