Skip to content
Commit 9310bd4b authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

usb: typec: anx7411: fix error checking in anx7411_get_gpio_irq()



This is a minor bug which means that certain error messages are not
printed.

The devm_gpiod_get_optional() function can return either error pointers
or NULL.  It returns error pointers if there is an allocation failure,
or a similar issue.  It returns NULL if no GPIO was assigned to the
requested function.  Print an error in either case.

The gpiod_to_irq() function never returns zero.  It either returns
a positive IRQ number or a negative error code.

Fixes: fe6d8a9c ("usb: typec: anx7411: Add Analogix PD ANX7411 support")
Reviewed-by: default avatarXin Ji <xji@analogixsemi.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YtpDs8VsWIbl/Smd@kili


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent cfed201e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment