Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge remote-tracking branch 'regulator/fix/core' into regulator-linus

+10 -11
+10 -11
drivers/regulator/core.c
··· 1394 1394 return 0; 1395 1395 1396 1396 r = regulator_dev_lookup(dev, rdev->supply_name, &ret); 1397 - if (ret == -ENODEV) { 1398 - /* 1399 - * No supply was specified for this regulator and 1400 - * there will never be one. 1401 - */ 1402 - return 0; 1403 - } 1404 - 1405 1397 if (!r) { 1398 + if (ret == -ENODEV) { 1399 + /* 1400 + * No supply was specified for this regulator and 1401 + * there will never be one. 1402 + */ 1403 + return 0; 1404 + } 1405 + 1406 1406 if (have_full_constraints()) { 1407 1407 r = dummy_regulator_rdev; 1408 1408 } else { ··· 1422 1422 return ret; 1423 1423 1424 1424 /* Cascade always-on state to supply */ 1425 - if (_regulator_is_enabled(rdev)) { 1425 + if (_regulator_is_enabled(rdev) && rdev->supply) { 1426 1426 ret = regulator_enable(rdev->supply); 1427 1427 if (ret < 0) { 1428 - if (rdev->supply) 1429 - _regulator_put(rdev->supply); 1428 + _regulator_put(rdev->supply); 1430 1429 return ret; 1431 1430 } 1432 1431 }