Commit b9c6f782 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

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: da0cb631 ("usb: typec: add support for STUSB160x Type-C controller family")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20201023114017.GE18329@kadamSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2d9c6442
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment