diff options
author | Mike Rapoport <mike@compulab.co.il> | 2009-03-31 18:24:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-01 11:59:26 -0400 |
commit | c08cf9daf66844c60ebe9f89885d3a3e1893e61f (patch) | |
tree | add5564b6e5e81208eb1ff7c46741aef141726f3 /drivers/rtc/rtc-v3020.c | |
parent | 62da659a7057f7227a99a42eea6aa606b09c1e8c (diff) |
rtc-v3020: coding style cleanup
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-v3020.c')
-rw-r--r-- | drivers/rtc/rtc-v3020.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/drivers/rtc/rtc-v3020.c b/drivers/rtc/rtc-v3020.c index 14d4f036a768..66955cc9c746 100644 --- a/drivers/rtc/rtc-v3020.c +++ b/drivers/rtc/rtc-v3020.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/rtc-v3020.h> | 28 | #include <linux/rtc-v3020.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | 30 | ||
31 | #include <asm/io.h> | 31 | #include <linux/io.h> |
32 | 32 | ||
33 | #undef DEBUG | 33 | #undef DEBUG |
34 | 34 | ||
@@ -63,7 +63,7 @@ static void v3020_set_reg(struct v3020 *chip, unsigned char address, | |||
63 | 63 | ||
64 | static unsigned char v3020_get_reg(struct v3020 *chip, unsigned char address) | 64 | static unsigned char v3020_get_reg(struct v3020 *chip, unsigned char address) |
65 | { | 65 | { |
66 | unsigned int data=0; | 66 | unsigned int data = 0; |
67 | int i; | 67 | int i; |
68 | 68 | ||
69 | for (i = 0; i < 4; i++) { | 69 | for (i = 0; i < 4; i++) { |
@@ -106,16 +106,14 @@ static int v3020_read_time(struct device *dev, struct rtc_time *dt) | |||
106 | tmp = v3020_get_reg(chip, V3020_YEAR); | 106 | tmp = v3020_get_reg(chip, V3020_YEAR); |
107 | dt->tm_year = bcd2bin(tmp)+100; | 107 | dt->tm_year = bcd2bin(tmp)+100; |
108 | 108 | ||
109 | #ifdef DEBUG | 109 | dev_dbg(dev, "\n%s : Read RTC values\n", __func__); |
110 | printk("\n%s : Read RTC values\n",__func__); | 110 | dev_dbg(dev, "tm_hour: %i\n", dt->tm_hour); |
111 | printk("tm_hour: %i\n",dt->tm_hour); | 111 | dev_dbg(dev, "tm_min : %i\n", dt->tm_min); |
112 | printk("tm_min : %i\n",dt->tm_min); | 112 | dev_dbg(dev, "tm_sec : %i\n", dt->tm_sec); |
113 | printk("tm_sec : %i\n",dt->tm_sec); | 113 | dev_dbg(dev, "tm_year: %i\n", dt->tm_year); |
114 | printk("tm_year: %i\n",dt->tm_year); | 114 | dev_dbg(dev, "tm_mon : %i\n", dt->tm_mon); |
115 | printk("tm_mon : %i\n",dt->tm_mon); | 115 | dev_dbg(dev, "tm_mday: %i\n", dt->tm_mday); |
116 | printk("tm_mday: %i\n",dt->tm_mday); | 116 | dev_dbg(dev, "tm_wday: %i\n", dt->tm_wday); |
117 | printk("tm_wday: %i\n",dt->tm_wday); | ||
118 | #endif | ||
119 | 117 | ||
120 | return 0; | 118 | return 0; |
121 | } | 119 | } |
@@ -125,15 +123,13 @@ static int v3020_set_time(struct device *dev, struct rtc_time *dt) | |||
125 | { | 123 | { |
126 | struct v3020 *chip = dev_get_drvdata(dev); | 124 | struct v3020 *chip = dev_get_drvdata(dev); |
127 | 125 | ||
128 | #ifdef DEBUG | 126 | dev_dbg(dev, "\n%s : Setting RTC values\n", __func__); |
129 | printk("\n%s : Setting RTC values\n",__func__); | 127 | dev_dbg(dev, "tm_sec : %i\n", dt->tm_sec); |
130 | printk("tm_sec : %i\n",dt->tm_sec); | 128 | dev_dbg(dev, "tm_min : %i\n", dt->tm_min); |
131 | printk("tm_min : %i\n",dt->tm_min); | 129 | dev_dbg(dev, "tm_hour: %i\n", dt->tm_hour); |
132 | printk("tm_hour: %i\n",dt->tm_hour); | 130 | dev_dbg(dev, "tm_mday: %i\n", dt->tm_mday); |
133 | printk("tm_mday: %i\n",dt->tm_mday); | 131 | dev_dbg(dev, "tm_wday: %i\n", dt->tm_wday); |
134 | printk("tm_wday: %i\n",dt->tm_wday); | 132 | dev_dbg(dev, "tm_year: %i\n", dt->tm_year); |
135 | printk("tm_year: %i\n",dt->tm_year); | ||
136 | #endif | ||
137 | 133 | ||
138 | /* Write all the values to ram... */ | 134 | /* Write all the values to ram... */ |
139 | v3020_set_reg(chip, V3020_SECONDS, bin2bcd(dt->tm_sec)); | 135 | v3020_set_reg(chip, V3020_SECONDS, bin2bcd(dt->tm_sec)); |
@@ -191,7 +187,7 @@ static int rtc_probe(struct platform_device *pdev) | |||
191 | /* Test chip by doing a write/read sequence | 187 | /* Test chip by doing a write/read sequence |
192 | * to the chip ram */ | 188 | * to the chip ram */ |
193 | v3020_set_reg(chip, V3020_SECONDS, 0x33); | 189 | v3020_set_reg(chip, V3020_SECONDS, 0x33); |
194 | if(v3020_get_reg(chip, V3020_SECONDS) != 0x33) { | 190 | if (v3020_get_reg(chip, V3020_SECONDS) != 0x33) { |
195 | retval = -ENODEV; | 191 | retval = -ENODEV; |
196 | goto err_io; | 192 | goto err_io; |
197 | } | 193 | } |