···13941394 return 0;1395139513961396 r = regulator_dev_lookup(dev, rdev->supply_name, &ret);13971397- if (ret == -ENODEV) {13981398- /*13991399- * No supply was specified for this regulator and14001400- * there will never be one.14011401- */14021402- return 0;14031403- }14041404-14051397 if (!r) {13981398+ if (ret == -ENODEV) {13991399+ /*14001400+ * No supply was specified for this regulator and14011401+ * there will never be one.14021402+ */14031403+ return 0;14041404+ }14051405+14061406 if (have_full_constraints()) {14071407 r = dummy_regulator_rdev;14081408 } else {···14221422 return ret;1423142314241424 /* Cascade always-on state to supply */14251425- if (_regulator_is_enabled(rdev)) {14251425+ if (_regulator_is_enabled(rdev) && rdev->supply) {14261426 ret = regulator_enable(rdev->supply);14271427 if (ret < 0) {14281428- if (rdev->supply)14291429- _regulator_put(rdev->supply);14281428+ _regulator_put(rdev->supply);14301429 return ret;14311430 }14321431 }