extcon: Fix extcon_get_extcon_dev() error handling
[platform/kernel/linux-rpi.git] / drivers / usb / typec / tcpm / fusb302.c
index 72f9001..96c55ea 100644 (file)
@@ -1708,8 +1708,8 @@ static int fusb302_probe(struct i2c_client *client,
         */
        if (device_property_read_string(dev, "linux,extcon-name", &name) == 0) {
                chip->extcon = extcon_get_extcon_dev(name);
-               if (!chip->extcon)
-                       return -EPROBE_DEFER;
+               if (IS_ERR(chip->extcon))
+                       return PTR_ERR(chip->extcon);
        }
 
        chip->vbus = devm_regulator_get(chip->dev, "vbus");