diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2021-03-12 11:36:02 +0300 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2021-03-22 17:55:38 +0300 |
commit | 417c0fc24dd4dbd60d94fa8deb36bf1176930e06 (patch) | |
tree | 9df5032371604c42ae56394520419e970dce6704 /drivers/power/supply/ab8500_charger.c | |
parent | 53207aa1a73e3e52b14c432b04d342c2b3af2e1c (diff) | |
download | linux-417c0fc24dd4dbd60d94fa8deb36bf1176930e06.tar.xz |
mfd/power: ab8500: Push data to power supply code
The global definition of platform data for the battery
management code has no utility after the OF conversion,
move the <linux/mfd/abx500/ab8500-bm.h> to be a local
file in drivers/power/supply and stop defining the
platform data in drivers/power/supply/ab8500_bmdata.c
and broadcast to the kernel only to have it assigned
as platform data to the MFD cells and then picked back
into the same subsystem that defined it in the first
place. This kills off a layer of indirection.
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>
Diffstat (limited to 'drivers/power/supply/ab8500_charger.c')
-rw-r--r-- | drivers/power/supply/ab8500_charger.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c index aa573cd299e2..50989a5ec95c 100644 --- a/drivers/power/supply/ab8500_charger.c +++ b/drivers/power/supply/ab8500_charger.c @@ -28,12 +28,13 @@ #include <linux/mfd/core.h> #include <linux/mfd/abx500/ab8500.h> #include <linux/mfd/abx500.h> -#include <linux/mfd/abx500/ab8500-bm.h> #include <linux/mfd/abx500/ux500_chargalg.h> #include <linux/usb/otg.h> #include <linux/mutex.h> #include <linux/iio/consumer.h> +#include "ab8500-bm.h" + /* Charger constants */ #define NO_PW_CONN 0 #define AC_PW_CONN 1 @@ -3344,7 +3345,6 @@ static const struct power_supply_desc ab8500_usb_chg_desc = { static int ab8500_charger_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - struct abx500_bm_data *plat = pdev->dev.platform_data; struct power_supply_config ac_psy_cfg = {}, usb_psy_cfg = {}; struct ab8500_charger *di; int irq, i, charger_status, ret = 0, ch_stat; @@ -3354,11 +3354,7 @@ static int ab8500_charger_probe(struct platform_device *pdev) if (!di) return -ENOMEM; - if (!plat) { - dev_err(dev, "no battery management data supplied\n"); - return -EINVAL; - } - di->bm = plat; + di->bm = &ab8500_bm_data; ret = ab8500_bm_of_probe(dev, np, di->bm); if (ret) { |