extcon: Fix extcon_get_extcon_dev() error handling
[platform/kernel/linux-rpi.git] / drivers / usb / phy / phy-omap-otg.c
index ee0863c..6e6ef8c 100644 (file)
@@ -95,8 +95,8 @@ static int omap_otg_probe(struct platform_device *pdev)
                return -ENODEV;
 
        extcon = extcon_get_extcon_dev(config->extcon);
-       if (!extcon)
-               return -EPROBE_DEFER;
+       if (IS_ERR(extcon))
+               return PTR_ERR(extcon);
 
        otg_dev = devm_kzalloc(&pdev->dev, sizeof(*otg_dev), GFP_KERNEL);
        if (!otg_dev)