power: ab8500: Require device tree
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 12 Mar 2021 08:36:01 +0000 (09:36 +0100)
committerLee Jones <lee.jones@linaro.org>
Mon, 22 Mar 2021 14:55:06 +0000 (14:55 +0000)
The core AB8500 driver and the whole platform is completely
dependent on being probed from device tree so remove the
non-DT probe paths.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/power/supply/Kconfig
drivers/power/supply/ab8500_btemp.c
drivers/power/supply/ab8500_charger.c
drivers/power/supply/ab8500_fg.c
drivers/power/supply/abx500_chargalg.c

index 006b95e..a910571 100644 (file)
@@ -698,7 +698,7 @@ config BATTERY_GAUGE_LTC2941
 
 config AB8500_BM
        bool "AB8500 Battery Management Driver"
-       depends on AB8500_CORE && AB8500_GPADC && (IIO = y)
+       depends on AB8500_CORE && AB8500_GPADC && (IIO = y) && OF
        help
          Say Y to include support for AB8500 battery management.
 
index d203453..3cec0af 100644 (file)
@@ -1008,12 +1008,10 @@ static int ab8500_btemp_probe(struct platform_device *pdev)
        }
        di->bm = plat;
 
-       if (np) {
-               ret = ab8500_bm_of_probe(dev, np, di->bm);
-               if (ret) {
-                       dev_err(dev, "failed to get battery information\n");
-                       return ret;
-               }
+       ret = ab8500_bm_of_probe(dev, np, di->bm);
+       if (ret) {
+               dev_err(dev, "failed to get battery information\n");
+               return ret;
        }
 
        /* get parent data */
index ac77c88..aa573cd 100644 (file)
@@ -3360,15 +3360,12 @@ static int ab8500_charger_probe(struct platform_device *pdev)
        }
        di->bm = plat;
 
-       if (np) {
-               ret = ab8500_bm_of_probe(dev, np, di->bm);
-               if (ret) {
-                       dev_err(dev, "failed to get battery information\n");
-                       return ret;
-               }
-               di->autopower_cfg = of_property_read_bool(np, "autopower_cfg");
-       } else
-               di->autopower_cfg = false;
+       ret = ab8500_bm_of_probe(dev, np, di->bm);
+       if (ret) {
+               dev_err(dev, "failed to get battery information\n");
+               return ret;
+       }
+       di->autopower_cfg = of_property_read_bool(np, "autopower_cfg");
 
        /* get parent data */
        di->dev = dev;
index 06ff42c..079e113 100644 (file)
@@ -3043,12 +3043,10 @@ static int ab8500_fg_probe(struct platform_device *pdev)
        }
        di->bm = plat;
 
-       if (np) {
-               ret = ab8500_bm_of_probe(dev, np, di->bm);
-               if (ret) {
-                       dev_err(dev, "failed to get battery information\n");
-                       return ret;
-               }
+       ret = ab8500_bm_of_probe(dev, np, di->bm);
+       if (ret) {
+               dev_err(dev, "failed to get battery information\n");
+               return ret;
        }
 
        mutex_init(&di->cc_lock);
index a9d84d8..591ddd2 100644 (file)
@@ -1997,12 +1997,10 @@ static int abx500_chargalg_probe(struct platform_device *pdev)
        }
        di->bm = plat;
 
-       if (np) {
-               ret = ab8500_bm_of_probe(&pdev->dev, np, di->bm);
-               if (ret) {
-                       dev_err(&pdev->dev, "failed to get battery information\n");
-                       return ret;
-               }
+       ret = ab8500_bm_of_probe(&pdev->dev, np, di->bm);
+       if (ret) {
+               dev_err(&pdev->dev, "failed to get battery information\n");
+               return ret;
        }
 
        /* get device struct and parent */