]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/mfd/abx500/ux500_chargalg.h
Merge branch 'for-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
[karo-tx-linux.git] / include / linux / mfd / abx500 / ux500_chargalg.h
index 234c99143bf778019c0ef28330c9967530bb7d43..67703f23e7ba2729c307899126422145055d665e 100644 (file)
@@ -9,8 +9,13 @@
 
 #include <linux/power_supply.h>
 
-#define psy_to_ux500_charger(x) container_of((x), \
-               struct ux500_charger, psy)
+/*
+ * Valid only for supplies of type:
+ * - POWER_SUPPLY_TYPE_MAINS,
+ * - 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)
 
 /* Forward declaration */
 struct ux500_charger;
@@ -35,7 +40,7 @@ struct ux500_charger_ops {
  * @power_path         USB power path support
  */
 struct ux500_charger {
-       struct power_supply psy;
+       struct power_supply *psy;
        struct ux500_charger_ops ops;
        int max_out_volt;
        int max_out_curr;