Commit 95e060e6 authored by Serge Semin's avatar Serge Semin Committed by Greg Kroah-Hartman

usb: usb251xb: Add an empty hub' i2c-bus segment checker

It's pointless to scan the hub' i2c-bus segment if GPIOs aren't supported
by the system, since no GPIO-driven reset could be cleared by the driver
then. Moreover if CONFIG_GPIOLIB is disabled the gpio_chip structure
definition won't be available, which causes the incomplete type pointer
dereference compilation error. In order to fix this we need to create an
empty usb251x_check_gpio_chip() method returning zero, so the driver would
skip the i2c-bus segment checking and proceed with further probing in this
case.

Fixes: 6e3c8beb ("usb: usb251xb: Lock i2c-bus segment the hub resides")
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Signed-off-by: default avatarSerge Semin <fancer.lancer@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a4d6a298
...@@ -223,6 +223,7 @@ static const struct usb251xb_data usb2517i_data = { ...@@ -223,6 +223,7 @@ static const struct usb251xb_data usb2517i_data = {
.product_str = "USB2517i", .product_str = "USB2517i",
}; };
#ifdef CONFIG_GPIOLIB
static int usb251xb_check_dev_children(struct device *dev, void *child) static int usb251xb_check_dev_children(struct device *dev, void *child)
{ {
if (dev->type == &i2c_adapter_type) { if (dev->type == &i2c_adapter_type) {
...@@ -253,6 +254,12 @@ static int usb251x_check_gpio_chip(struct usb251xb *hub) ...@@ -253,6 +254,12 @@ static int usb251x_check_gpio_chip(struct usb251xb *hub)
return 0; return 0;
} }
#else
static int usb251x_check_gpio_chip(struct usb251xb *hub)
{
return 0;
}
#endif
static void usb251xb_reset(struct usb251xb *hub, int state) static void usb251xb_reset(struct usb251xb *hub, int state)
{ {
......
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