# \[PATCH\] power: supply: ab8500: Fix an old bug

- From: Linus Walleij \<hidden\>
- Date: 2021-06-26 23:49:56 
- List: linux-pm
- Page: https://ratatoskr.run/linux-pm/2021/06/6880526
- Thread: https://ratatoskr.run/linux-pm/2021/06/6880526/t.md

```text
Trying to get the AB8500 charging driver working I ran into a bit
of bitrot: we haven't used the driver for a while so errors in
refactorings won't be noticed.

This one is pretty self evident: use argument to the macro or we
end up with a random pointer to something else.

Cc: <redacted>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Marcus Cooper <redacted>
Fixes: 297d716f6260 ("power_supply: Change ownership from driver to core")
Signed-off-by: Linus Walleij <redacted>
---
 drivers/power/supply/ab8500-chargalg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/ab8500-chargalg.h b/drivers/power/supply/ab8500-chargalg.h
index 94a6f9068bc5..07e6ff50084f 100644
--- a/drivers/power/supply/ab8500-chargalg.h
+++ b/drivers/power/supply/ab8500-chargalg.h
@@ -15,7 +15,7 @@
  * - POWER_SUPPLY_TYPE_USB,
  * because only them store as drv_data pointer to struct ux500_charger.
  */
-#define psy_to_ux500_charger(x) power_supply_get_drvdata(psy)
+#define psy_to_ux500_charger(x) power_supply_get_drvdata(x)
 
 /* Forward declaration */
 struct ux500_charger;
-- 
2.31.1

```
