diff options
Diffstat (limited to 'drivers/power/ab8500_btemp.c')
-rw-r--r-- | drivers/power/ab8500_btemp.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c index e266f038a110..bba3ccac72fe 100644 --- a/drivers/power/ab8500_btemp.c +++ b/drivers/power/ab8500_btemp.c | |||
@@ -964,10 +964,15 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev) | |||
964 | { | 964 | { |
965 | int irq, i, ret = 0; | 965 | int irq, i, ret = 0; |
966 | u8 val; | 966 | u8 val; |
967 | struct abx500_bm_plat_data *plat_data; | 967 | struct abx500_bm_plat_data *plat_data = pdev->dev.platform_data; |
968 | struct ab8500_btemp *di; | ||
969 | |||
970 | if (!plat_data) { | ||
971 | dev_err(&pdev->dev, "No platform data\n"); | ||
972 | return -EINVAL; | ||
973 | } | ||
968 | 974 | ||
969 | struct ab8500_btemp *di = | 975 | di = kzalloc(sizeof(*di), GFP_KERNEL); |
970 | kzalloc(sizeof(struct ab8500_btemp), GFP_KERNEL); | ||
971 | if (!di) | 976 | if (!di) |
972 | return -ENOMEM; | 977 | return -ENOMEM; |
973 | 978 | ||
@@ -977,13 +982,12 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev) | |||
977 | di->gpadc = ab8500_gpadc_get("ab8500-gpadc.0"); | 982 | di->gpadc = ab8500_gpadc_get("ab8500-gpadc.0"); |
978 | 983 | ||
979 | /* get btemp specific platform data */ | 984 | /* get btemp specific platform data */ |
980 | plat_data = pdev->dev.platform_data; | 985 | di->pdata = plat_data->btemp; |
981 | if (!plat_data || !plat_data->btemp) { | 986 | if (!di->pdata) { |
982 | dev_err(di->dev, "no btemp platform data supplied\n"); | 987 | dev_err(di->dev, "no btemp platform data supplied\n"); |
983 | ret = -EINVAL; | 988 | ret = -EINVAL; |
984 | goto free_device_info; | 989 | goto free_device_info; |
985 | } | 990 | } |
986 | di->pdata = plat_data->btemp; | ||
987 | 991 | ||
988 | /* get battery specific platform data */ | 992 | /* get battery specific platform data */ |
989 | di->bat = plat_data->battery; | 993 | di->bat = plat_data->battery; |