static int mv_otg_enable_internal(struct mv_otg *mvotg) { int retval = 0; if (mvotg->active) return 0; dev_dbg(&mvotg->pdev->dev, "otg enabled\n"); otg_clock_enable(mvotg); retval = usb_phy_init(mvotg->outer_phy); if (retval) { dev_err(&mvotg->pdev->dev, "failed to initialize phy %d\n", retval); otg_clock_disable(mvotg); return retval; } mvotg->active = 1; return 0; }
static int mv_otg_enable_internal(struct mv_otg *mvotg) { int retval = 0; if (mvotg->active) return 0; dev_dbg(&mvotg->pdev->dev, "otg enabled\n"); otg_clock_enable(mvotg); if (mvotg->pdata->phy_init) { retval = mvotg->pdata->phy_init(mvotg->phy_regs); if (retval) { dev_err(&mvotg->pdev->dev, "init phy error %d\n", retval); otg_clock_disable(mvotg); return retval; } } mvotg->active = 1; return 0; }