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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'regulator-fix-v6.19-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fixes from Mark Brown:
"A few fixes that came in during the merge window, nothing too
exciting - the one core fix improves error propagation from gpiolib
which hopefully shouldn't actually happen but is safer"

* tag 'regulator-fix-v6.19-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
regulator: spacemit: Align input supply name with the DT binding
regulator: fixed: Rely on the core freeing the enable GPIO
regulator: check the return value of gpiod_set_value_cansleep()

+16 -12
+10 -3
drivers/regulator/core.c
··· 2823 2823 static int regulator_ena_gpio_ctrl(struct regulator_dev *rdev, bool enable) 2824 2824 { 2825 2825 struct regulator_enable_gpio *pin = rdev->ena_pin; 2826 + int ret; 2826 2827 2827 2828 if (!pin) 2828 2829 return -EINVAL; 2829 2830 2830 2831 if (enable) { 2831 2832 /* Enable GPIO at initial use */ 2832 - if (pin->enable_count == 0) 2833 - gpiod_set_value_cansleep(pin->gpiod, 1); 2833 + if (pin->enable_count == 0) { 2834 + ret = gpiod_set_value_cansleep(pin->gpiod, 1); 2835 + if (ret) 2836 + return ret; 2837 + } 2834 2838 2835 2839 pin->enable_count++; 2836 2840 } else { ··· 2845 2841 2846 2842 /* Disable GPIO if not used */ 2847 2843 if (pin->enable_count <= 1) { 2848 - gpiod_set_value_cansleep(pin->gpiod, 0); 2844 + ret = gpiod_set_value_cansleep(pin->gpiod, 0); 2845 + if (ret) 2846 + return ret; 2847 + 2849 2848 pin->enable_count = 0; 2850 2849 } 2851 2850 }
+4 -7
drivers/regulator/fixed.c
··· 330 330 331 331 drvdata->dev = devm_regulator_register(&pdev->dev, &drvdata->desc, 332 332 &cfg); 333 - if (IS_ERR(drvdata->dev)) { 334 - ret = dev_err_probe(&pdev->dev, PTR_ERR(drvdata->dev), 335 - "Failed to register regulator: %ld\n", 336 - PTR_ERR(drvdata->dev)); 337 - gpiod_put(cfg.ena_gpiod); 338 - return ret; 339 - } 333 + if (IS_ERR(drvdata->dev)) 334 + return dev_err_probe(&pdev->dev, PTR_ERR(drvdata->dev), 335 + "Failed to register regulator: %ld\n", 336 + PTR_ERR(drvdata->dev)); 340 337 341 338 platform_set_drvdata(pdev, drvdata); 342 339
+2 -2
drivers/regulator/spacemit-p1.c
··· 87 87 } 88 88 89 89 #define P1_BUCK_DESC(_n) \ 90 - P1_REG_DESC(BUCK, buck, _n, "vcc", 0x47, BUCK_MASK, 254, p1_buck_ranges) 90 + P1_REG_DESC(BUCK, buck, _n, "vin", 0x47, BUCK_MASK, 254, p1_buck_ranges) 91 91 92 92 #define P1_ALDO_DESC(_n) \ 93 - P1_REG_DESC(ALDO, aldo, _n, "vcc", 0x5b, LDO_MASK, 117, p1_ldo_ranges) 93 + P1_REG_DESC(ALDO, aldo, _n, "vin", 0x5b, LDO_MASK, 117, p1_ldo_ranges) 94 94 95 95 #define P1_DLDO_DESC(_n) \ 96 96 P1_REG_DESC(DLDO, dldo, _n, "buck5", 0x67, LDO_MASK, 117, p1_ldo_ranges)