diff options
Diffstat (limited to 'drivers/power/ab8500_btemp.c')
-rw-r--r-- | drivers/power/ab8500_btemp.c | 15 |
1 files changed, 5 insertions, 10 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 */ |