summaryrefslogtreecommitdiff
path: root/drivers/usb/misc/onboard_usb_dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/misc/onboard_usb_dev.c')
-rw-r--r--drivers/usb/misc/onboard_usb_dev.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/misc/onboard_usb_dev.c b/drivers/usb/misc/onboard_usb_dev.c
index 560591e02d6a..75dfdca04ff1 100644
--- a/drivers/usb/misc/onboard_usb_dev.c
+++ b/drivers/usb/misc/onboard_usb_dev.c
@@ -311,7 +311,7 @@ static void onboard_dev_attach_usb_driver(struct work_struct *work)
static int onboard_dev_5744_i2c_init(struct i2c_client *client)
{
-#if IS_ENABLED(CONFIG_I2C)
+#if IS_ENABLED(CONFIG_USB_ONBOARD_DEV_USB5744)
struct device *dev = &client->dev;
int ret;
@@ -394,9 +394,11 @@ static int onboard_dev_probe(struct platform_device *pdev)
i2c_node = of_parse_phandle(pdev->dev.of_node, "i2c-bus", 0);
if (i2c_node) {
- struct i2c_client *client;
+ struct i2c_client *client = NULL;
+#if IS_ENABLED(CONFIG_USB_ONBOARD_DEV_USB5744)
client = of_find_i2c_device_by_node(i2c_node);
+#endif
of_node_put(i2c_node);
if (!client) {