aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ucb1x00-assabet.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/ucb1x00-assabet.c')
-rw-r--r--drivers/mfd/ucb1x00-assabet.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/mfd/ucb1x00-assabet.c b/drivers/mfd/ucb1x00-assabet.c
index e325fa71f38b..b7c8e7813865 100644
--- a/drivers/mfd/ucb1x00-assabet.c
+++ b/drivers/mfd/ucb1x00-assabet.c
@@ -20,7 +20,8 @@
20#include "ucb1x00.h" 20#include "ucb1x00.h"
21 21
22#define UCB1X00_ATTR(name,input)\ 22#define UCB1X00_ATTR(name,input)\
23static ssize_t name##_show(struct class_device *dev, char *buf) \ 23static ssize_t name##_show(struct device *dev, struct device_attribute *attr,
24 char *buf) \
24{ \ 25{ \
25 struct ucb1x00 *ucb = classdev_to_ucb1x00(dev); \ 26 struct ucb1x00 *ucb = classdev_to_ucb1x00(dev); \
26 int val; \ 27 int val; \
@@ -29,7 +30,7 @@ static ssize_t name##_show(struct class_device *dev, char *buf) \
29 ucb1x00_adc_disable(ucb); \ 30 ucb1x00_adc_disable(ucb); \
30 return sprintf(buf, "%d\n", val); \ 31 return sprintf(buf, "%d\n", val); \
31} \ 32} \
32static CLASS_DEVICE_ATTR(name,0444,name##_show,NULL) 33static DEVICE_ATTR(name,0444,name##_show,NULL)
33 34
34UCB1X00_ATTR(vbatt, UCB_ADC_INP_AD1); 35UCB1X00_ATTR(vbatt, UCB_ADC_INP_AD1);
35UCB1X00_ATTR(vcharger, UCB_ADC_INP_AD0); 36UCB1X00_ATTR(vcharger, UCB_ADC_INP_AD0);
@@ -37,17 +38,17 @@ UCB1X00_ATTR(batt_temp, UCB_ADC_INP_AD2);
37 38
38static int ucb1x00_assabet_add(struct ucb1x00_dev *dev) 39static int ucb1x00_assabet_add(struct ucb1x00_dev *dev)
39{ 40{
40 class_device_create_file(&dev->ucb->cdev, &class_device_attr_vbatt); 41 device_create_file(&dev->ucb->dev, &device_attr_vbatt);
41 class_device_create_file(&dev->ucb->cdev, &class_device_attr_vcharger); 42 device_create_file(&dev->ucb->dev, &device_attr_vcharger);
42 class_device_create_file(&dev->ucb->cdev, &class_device_attr_batt_temp); 43 device_create_file(&dev->ucb->dev, &device_attr_batt_temp);
43 return 0; 44 return 0;
44} 45}
45 46
46static void ucb1x00_assabet_remove(struct ucb1x00_dev *dev) 47static void ucb1x00_assabet_remove(struct ucb1x00_dev *dev)
47{ 48{
48 class_device_remove_file(&dev->ucb->cdev, &class_device_attr_batt_temp); 49 device_remove_file(&dev->ucb->cdev, &device_attr_batt_temp);
49 class_device_remove_file(&dev->ucb->cdev, &class_device_attr_vcharger); 50 device_remove_file(&dev->ucb->cdev, &device_attr_vcharger);
50 class_device_remove_file(&dev->ucb->cdev, &class_device_attr_vbatt); 51 device_remove_file(&dev->ucb->cdev, &device_attr_vbatt);
51} 52}
52 53
53static struct ucb1x00_driver ucb1x00_assabet_driver = { 54static struct ucb1x00_driver ucb1x00_assabet_driver = {