diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-18 22:26:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-18 22:26:54 -0400 |
commit | 814a2bf957739f367cbebfa1b60237387b72d0ee (patch) | |
tree | 8d65c38d14beb8d6d2dc5b9d7f8dbe63c7cad31a /drivers/power | |
parent | 237045fc3c67d44088f767dca5a9fa30815eba62 (diff) | |
parent | f9310b2f9a19b7f16c7b1c1558f8b649b9b933c1 (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge second patch-bomb from Andrew Morton:
- a couple of hotfixes
- the rest of MM
- a new timer slack control in procfs
- a couple of procfs fixes
- a few misc things
- some printk tweaks
- lib/ updates, notably to radix-tree.
- add my and Nick Piggin's old userspace radix-tree test harness to
tools/testing/radix-tree/. Matthew said it was a godsend during the
radix-tree work he did.
- a few code-size improvements, switching to __always_inline where gcc
screwed up.
- partially implement character sets in sscanf
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (118 commits)
sscanf: implement basic character sets
lib/bug.c: use common WARN helper
param: convert some "on"/"off" users to strtobool
lib: add "on"/"off" support to kstrtobool
lib: update single-char callers of strtobool()
lib: move strtobool() to kstrtobool()
include/linux/unaligned: force inlining of byteswap operations
include/uapi/linux/byteorder, swab: force inlining of some byteswap operations
include/asm-generic/atomic-long.h: force inlining of some atomic_long operations
usb: common: convert to use match_string() helper
ide: hpt366: convert to use match_string() helper
ata: hpt366: convert to use match_string() helper
power: ab8500: convert to use match_string() helper
power: charger_manager: convert to use match_string() helper
drm/edid: convert to use match_string() helper
pinctrl: convert to use match_string() helper
device property: convert to use match_string() helper
lib/string: introduce match_string() helper
radix-tree tests: add test for radix_tree_iter_next
radix-tree tests: add regression3 test
...
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/ab8500_btemp.c | 15 | ||||
-rw-r--r-- | drivers/power/ab8500_charger.c | 16 | ||||
-rw-r--r-- | drivers/power/ab8500_fg.c | 15 | ||||
-rw-r--r-- | drivers/power/abx500_chargalg.c | 14 | ||||
-rw-r--r-- | drivers/power/charger-manager.c | 27 |
5 files changed, 24 insertions, 63 deletions
diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c index 8f8044e1acf3..bf2e5dd301e7 100644 --- a/drivers/power/ab8500_btemp.c +++ b/drivers/power/ab8500_btemp.c | |||
@@ -906,26 +906,21 @@ static int ab8500_btemp_get_property(struct power_supply *psy, | |||
906 | static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data) | 906 | static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data) |
907 | { | 907 | { |
908 | struct power_supply *psy; | 908 | struct power_supply *psy; |
909 | struct power_supply *ext; | 909 | struct power_supply *ext = dev_get_drvdata(dev); |
910 | const char **supplicants = (const char **)ext->supplied_to; | ||
910 | struct ab8500_btemp *di; | 911 | struct ab8500_btemp *di; |
911 | union power_supply_propval ret; | 912 | union power_supply_propval ret; |
912 | int i, j; | 913 | int j; |
913 | bool psy_found = false; | ||
914 | 914 | ||
915 | psy = (struct power_supply *)data; | 915 | psy = (struct power_supply *)data; |
916 | ext = dev_get_drvdata(dev); | ||
917 | di = power_supply_get_drvdata(psy); | 916 | di = power_supply_get_drvdata(psy); |
918 | 917 | ||
919 | /* | 918 | /* |
920 | * For all psy where the name of your driver | 919 | * For all psy where the name of your driver |
921 | * appears in any supplied_to | 920 | * appears in any supplied_to |
922 | */ | 921 | */ |
923 | for (i = 0; i < ext->num_supplicants; i++) { | 922 | j = match_string(supplicants, ext->num_supplicants, psy->desc->name); |
924 | if (!strcmp(ext->supplied_to[i], psy->desc->name)) | 923 | if (j < 0) |
925 | psy_found = true; | ||
926 | } | ||
927 | |||
928 | if (!psy_found) | ||
929 | return 0; | 924 | return 0; |
930 | 925 | ||
931 | /* Go through all properties for the psy */ | 926 | /* Go through all properties for the psy */ |
diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c index e388171f4e58..30de5d42b26a 100644 --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c | |||
@@ -1929,11 +1929,11 @@ static int ab8540_charger_usb_pre_chg_enable(struct ux500_charger *charger, | |||
1929 | static int ab8500_charger_get_ext_psy_data(struct device *dev, void *data) | 1929 | static int ab8500_charger_get_ext_psy_data(struct device *dev, void *data) |
1930 | { | 1930 | { |
1931 | struct power_supply *psy; | 1931 | struct power_supply *psy; |
1932 | struct power_supply *ext; | 1932 | struct power_supply *ext = dev_get_drvdata(dev); |
1933 | const char **supplicants = (const char **)ext->supplied_to; | ||
1933 | struct ab8500_charger *di; | 1934 | struct ab8500_charger *di; |
1934 | union power_supply_propval ret; | 1935 | union power_supply_propval ret; |
1935 | int i, j; | 1936 | int j; |
1936 | bool psy_found = false; | ||
1937 | struct ux500_charger *usb_chg; | 1937 | struct ux500_charger *usb_chg; |
1938 | 1938 | ||
1939 | usb_chg = (struct ux500_charger *)data; | 1939 | usb_chg = (struct ux500_charger *)data; |
@@ -1941,15 +1941,9 @@ static int ab8500_charger_get_ext_psy_data(struct device *dev, void *data) | |||
1941 | 1941 | ||
1942 | di = to_ab8500_charger_usb_device_info(usb_chg); | 1942 | di = to_ab8500_charger_usb_device_info(usb_chg); |
1943 | 1943 | ||
1944 | ext = dev_get_drvdata(dev); | ||
1945 | |||
1946 | /* For all psy where the driver name appears in any supplied_to */ | 1944 | /* For all psy where the driver name appears in any supplied_to */ |
1947 | for (i = 0; i < ext->num_supplicants; i++) { | 1945 | j = match_string(supplicants, ext->num_supplicants, psy->desc->name); |
1948 | if (!strcmp(ext->supplied_to[i], psy->desc->name)) | 1946 | if (j < 0) |
1949 | psy_found = true; | ||
1950 | } | ||
1951 | |||
1952 | if (!psy_found) | ||
1953 | return 0; | 1947 | return 0; |
1954 | 1948 | ||
1955 | /* Go through all properties for the psy */ | 1949 | /* Go through all properties for the psy */ |
diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index 3830dade5d69..5a36cf88578a 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c | |||
@@ -2168,26 +2168,21 @@ static int ab8500_fg_get_property(struct power_supply *psy, | |||
2168 | static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data) | 2168 | static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data) |
2169 | { | 2169 | { |
2170 | struct power_supply *psy; | 2170 | struct power_supply *psy; |
2171 | struct power_supply *ext; | 2171 | struct power_supply *ext = dev_get_drvdata(dev); |
2172 | const char **supplicants = (const char **)ext->supplied_to; | ||
2172 | struct ab8500_fg *di; | 2173 | struct ab8500_fg *di; |
2173 | union power_supply_propval ret; | 2174 | union power_supply_propval ret; |
2174 | int i, j; | 2175 | int j; |
2175 | bool psy_found = false; | ||
2176 | 2176 | ||
2177 | psy = (struct power_supply *)data; | 2177 | psy = (struct power_supply *)data; |
2178 | ext = dev_get_drvdata(dev); | ||
2179 | di = power_supply_get_drvdata(psy); | 2178 | di = power_supply_get_drvdata(psy); |
2180 | 2179 | ||
2181 | /* | 2180 | /* |
2182 | * For all psy where the name of your driver | 2181 | * For all psy where the name of your driver |
2183 | * appears in any supplied_to | 2182 | * appears in any supplied_to |
2184 | */ | 2183 | */ |
2185 | for (i = 0; i < ext->num_supplicants; i++) { | 2184 | j = match_string(supplicants, ext->num_supplicants, psy->desc->name); |
2186 | if (!strcmp(ext->supplied_to[i], psy->desc->name)) | 2185 | if (j < 0) |
2187 | psy_found = true; | ||
2188 | } | ||
2189 | |||
2190 | if (!psy_found) | ||
2191 | return 0; | 2186 | return 0; |
2192 | 2187 | ||
2193 | /* Go through all properties for the psy */ | 2188 | /* Go through all properties for the psy */ |
diff --git a/drivers/power/abx500_chargalg.c b/drivers/power/abx500_chargalg.c index 541f702e0451..d9104b1ab7cf 100644 --- a/drivers/power/abx500_chargalg.c +++ b/drivers/power/abx500_chargalg.c | |||
@@ -975,22 +975,18 @@ static void handle_maxim_chg_curr(struct abx500_chargalg *di) | |||
975 | static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data) | 975 | static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data) |
976 | { | 976 | { |
977 | struct power_supply *psy; | 977 | struct power_supply *psy; |
978 | struct power_supply *ext; | 978 | struct power_supply *ext = dev_get_drvdata(dev); |
979 | const char **supplicants = (const char **)ext->supplied_to; | ||
979 | struct abx500_chargalg *di; | 980 | struct abx500_chargalg *di; |
980 | union power_supply_propval ret; | 981 | union power_supply_propval ret; |
981 | int i, j; | 982 | int j; |
982 | bool psy_found = false; | ||
983 | bool capacity_updated = false; | 983 | bool capacity_updated = false; |
984 | 984 | ||
985 | psy = (struct power_supply *)data; | 985 | psy = (struct power_supply *)data; |
986 | ext = dev_get_drvdata(dev); | ||
987 | di = power_supply_get_drvdata(psy); | 986 | di = power_supply_get_drvdata(psy); |
988 | /* For all psy where the driver name appears in any supplied_to */ | 987 | /* For all psy where the driver name appears in any supplied_to */ |
989 | for (i = 0; i < ext->num_supplicants; i++) { | 988 | j = match_string(supplicants, ext->num_supplicants, psy->desc->name); |
990 | if (!strcmp(ext->supplied_to[i], psy->desc->name)) | 989 | if (j < 0) |
991 | psy_found = true; | ||
992 | } | ||
993 | if (!psy_found) | ||
994 | return 0; | 990 | return 0; |
995 | 991 | ||
996 | /* | 992 | /* |
diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c index 1ea5d1aa268b..e664ca7c0afd 100644 --- a/drivers/power/charger-manager.c +++ b/drivers/power/charger-manager.c | |||
@@ -2020,27 +2020,6 @@ static void __exit charger_manager_cleanup(void) | |||
2020 | module_exit(charger_manager_cleanup); | 2020 | module_exit(charger_manager_cleanup); |
2021 | 2021 | ||
2022 | /** | 2022 | /** |
2023 | * find_power_supply - find the associated power_supply of charger | ||
2024 | * @cm: the Charger Manager representing the battery | ||
2025 | * @psy: pointer to instance of charger's power_supply | ||
2026 | */ | ||
2027 | static bool find_power_supply(struct charger_manager *cm, | ||
2028 | struct power_supply *psy) | ||
2029 | { | ||
2030 | int i; | ||
2031 | bool found = false; | ||
2032 | |||
2033 | for (i = 0; cm->desc->psy_charger_stat[i]; i++) { | ||
2034 | if (!strcmp(psy->desc->name, cm->desc->psy_charger_stat[i])) { | ||
2035 | found = true; | ||
2036 | break; | ||
2037 | } | ||
2038 | } | ||
2039 | |||
2040 | return found; | ||
2041 | } | ||
2042 | |||
2043 | /** | ||
2044 | * cm_notify_event - charger driver notify Charger Manager of charger event | 2023 | * cm_notify_event - charger driver notify Charger Manager of charger event |
2045 | * @psy: pointer to instance of charger's power_supply | 2024 | * @psy: pointer to instance of charger's power_supply |
2046 | * @type: type of charger event | 2025 | * @type: type of charger event |
@@ -2057,9 +2036,11 @@ void cm_notify_event(struct power_supply *psy, enum cm_event_types type, | |||
2057 | 2036 | ||
2058 | mutex_lock(&cm_list_mtx); | 2037 | mutex_lock(&cm_list_mtx); |
2059 | list_for_each_entry(cm, &cm_list, entry) { | 2038 | list_for_each_entry(cm, &cm_list, entry) { |
2060 | found_power_supply = find_power_supply(cm, psy); | 2039 | if (match_string(cm->desc->psy_charger_stat, -1, |
2061 | if (found_power_supply) | 2040 | psy->desc->name) >= 0) { |
2041 | found_power_supply = true; | ||
2062 | break; | 2042 | break; |
2043 | } | ||
2063 | } | 2044 | } |
2064 | mutex_unlock(&cm_list_mtx); | 2045 | mutex_unlock(&cm_list_mtx); |
2065 | 2046 | ||