usb: chipidea: core: change vbus-regulator as optional
authorPeter Chen <peter.chen@nxp.com>
Mon, 23 Sep 2019 02:34:38 +0000 (10:34 +0800)
committerPeter Chen <peter.chen@nxp.com>
Mon, 18 Nov 2019 08:45:30 +0000 (16:45 +0800)
Vbus regualtor is an optional regulator, for platforms, which
doesn't have this regulator, it will get a dummy regulator and
show warning message.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/chipidea/core.c

index 98ee575ee500eb04ef753dabcea10f3ef2eaff16..dce5db41501c3412d06e506907683f3e6ec62cde 100644 (file)
@@ -683,7 +683,7 @@ static int ci_get_platdata(struct device *dev,
 
        if (platdata->dr_mode != USB_DR_MODE_PERIPHERAL) {
                /* Get the vbus regulator */
-               platdata->reg_vbus = devm_regulator_get(dev, "vbus");
+               platdata->reg_vbus = devm_regulator_get_optional(dev, "vbus");
                if (PTR_ERR(platdata->reg_vbus) == -EPROBE_DEFER) {
                        return -EPROBE_DEFER;
                } else if (PTR_ERR(platdata->reg_vbus) == -ENODEV) {