]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: adc: stm32: Drop unnecessary DT property presence check
authorRob Herring (Arm) <robh@kernel.org>
Thu, 9 Jan 2025 18:23:25 +0000 (12:23 -0600)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 3 Feb 2025 19:15:37 +0000 (19:15 +0000)
There's no reason to check for regulator supply property presence before
calling devm_regulator_get_optional() as that will return -ENODEV if
the supply is not present.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Acked-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Tested-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://patch.msgid.link/20250109182325.3973684-2-robh@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/stm32-adc-core.c

index 2201ee9987ae426a2497a2725a85ec877d52fea0..0914148d1a22682f8f96250e0ec7519d8989866f 100644 (file)
@@ -615,8 +615,7 @@ static int stm32_adc_core_switches_probe(struct device *dev,
        }
 
        /* Booster can be used to supply analog switches (optional) */
-       if (priv->cfg->has_syscfg & HAS_VBOOSTER &&
-           of_property_read_bool(np, "booster-supply")) {
+       if (priv->cfg->has_syscfg & HAS_VBOOSTER) {
                priv->booster = devm_regulator_get_optional(dev, "booster");
                if (IS_ERR(priv->booster)) {
                        ret = PTR_ERR(priv->booster);
@@ -628,8 +627,7 @@ static int stm32_adc_core_switches_probe(struct device *dev,
        }
 
        /* Vdd can be used to supply analog switches (optional) */
-       if (priv->cfg->has_syscfg & HAS_ANASWVDD &&
-           of_property_read_bool(np, "vdd-supply")) {
+       if (priv->cfg->has_syscfg & HAS_ANASWVDD) {
                priv->vdd = devm_regulator_get_optional(dev, "vdd");
                if (IS_ERR(priv->vdd)) {
                        ret = PTR_ERR(priv->vdd);