diff options
Diffstat (limited to 'drivers/rtc/rtc-ds1305.c')
-rw-r--r-- | drivers/rtc/rtc-ds1305.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index bb5f13f63630..dd6170acde95 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c | |||
@@ -158,7 +158,7 @@ static int ds1305_alarm_irq_enable(struct device *dev, unsigned int enabled) | |||
158 | goto done; | 158 | goto done; |
159 | buf[1] &= ~DS1305_AEI0; | 159 | buf[1] &= ~DS1305_AEI0; |
160 | } | 160 | } |
161 | err = spi_write_then_read(ds1305->spi, buf, sizeof buf, NULL, 0); | 161 | err = spi_write_then_read(ds1305->spi, buf, sizeof(buf), NULL, 0); |
162 | if (err >= 0) | 162 | if (err >= 0) |
163 | ds1305->ctrl[0] = buf[1]; | 163 | ds1305->ctrl[0] = buf[1]; |
164 | done: | 164 | done: |
@@ -181,8 +181,8 @@ static int ds1305_get_time(struct device *dev, struct rtc_time *time) | |||
181 | /* Use write-then-read to get all the date/time registers | 181 | /* Use write-then-read to get all the date/time registers |
182 | * since dma from stack is nonportable | 182 | * since dma from stack is nonportable |
183 | */ | 183 | */ |
184 | status = spi_write_then_read(ds1305->spi, &addr, sizeof addr, | 184 | status = spi_write_then_read(ds1305->spi, &addr, sizeof(addr), |
185 | buf, sizeof buf); | 185 | buf, sizeof(buf)); |
186 | if (status < 0) | 186 | if (status < 0) |
187 | return status; | 187 | return status; |
188 | 188 | ||
@@ -237,7 +237,7 @@ static int ds1305_set_time(struct device *dev, struct rtc_time *time) | |||
237 | buf[4], buf[5], buf[6], buf[7]); | 237 | buf[4], buf[5], buf[6], buf[7]); |
238 | 238 | ||
239 | /* use write-then-read since dma from stack is nonportable */ | 239 | /* use write-then-read since dma from stack is nonportable */ |
240 | return spi_write_then_read(ds1305->spi, buf, sizeof buf, | 240 | return spi_write_then_read(ds1305->spi, buf, sizeof(buf), |
241 | NULL, 0); | 241 | NULL, 0); |
242 | } | 242 | } |
243 | 243 | ||
@@ -286,8 +286,8 @@ static int ds1305_get_alarm(struct device *dev, struct rtc_wkalrm *alm) | |||
286 | * of EFI status is at best fragile anyway (given IRQ handlers). | 286 | * of EFI status is at best fragile anyway (given IRQ handlers). |
287 | */ | 287 | */ |
288 | addr = DS1305_CONTROL; | 288 | addr = DS1305_CONTROL; |
289 | status = spi_write_then_read(spi, &addr, sizeof addr, | 289 | status = spi_write_then_read(spi, &addr, sizeof(addr), |
290 | ds1305->ctrl, sizeof ds1305->ctrl); | 290 | ds1305->ctrl, sizeof(ds1305->ctrl)); |
291 | if (status < 0) | 291 | if (status < 0) |
292 | return status; | 292 | return status; |
293 | 293 | ||
@@ -296,8 +296,8 @@ static int ds1305_get_alarm(struct device *dev, struct rtc_wkalrm *alm) | |||
296 | 296 | ||
297 | /* get and check ALM0 registers */ | 297 | /* get and check ALM0 registers */ |
298 | addr = DS1305_ALM0(DS1305_SEC); | 298 | addr = DS1305_ALM0(DS1305_SEC); |
299 | status = spi_write_then_read(spi, &addr, sizeof addr, | 299 | status = spi_write_then_read(spi, &addr, sizeof(addr), |
300 | buf, sizeof buf); | 300 | buf, sizeof(buf)); |
301 | if (status < 0) | 301 | if (status < 0) |
302 | return status; | 302 | return status; |
303 | 303 | ||
@@ -381,7 +381,7 @@ static int ds1305_set_alarm(struct device *dev, struct rtc_wkalrm *alm) | |||
381 | "alm0 write", buf[1 + DS1305_SEC], buf[1 + DS1305_MIN], | 381 | "alm0 write", buf[1 + DS1305_SEC], buf[1 + DS1305_MIN], |
382 | buf[1 + DS1305_HOUR], buf[1 + DS1305_WDAY]); | 382 | buf[1 + DS1305_HOUR], buf[1 + DS1305_WDAY]); |
383 | 383 | ||
384 | status = spi_write_then_read(spi, buf, sizeof buf, NULL, 0); | 384 | status = spi_write_then_read(spi, buf, sizeof(buf), NULL, 0); |
385 | if (status < 0) | 385 | if (status < 0) |
386 | return status; | 386 | return status; |
387 | 387 | ||
@@ -474,7 +474,7 @@ static void ds1305_work(struct work_struct *work) | |||
474 | buf[1] = ds1305->ctrl[0]; | 474 | buf[1] = ds1305->ctrl[0]; |
475 | buf[2] = 0; | 475 | buf[2] = 0; |
476 | 476 | ||
477 | status = spi_write_then_read(spi, buf, sizeof buf, | 477 | status = spi_write_then_read(spi, buf, sizeof(buf), |
478 | NULL, 0); | 478 | NULL, 0); |
479 | if (status < 0) | 479 | if (status < 0) |
480 | dev_dbg(&spi->dev, "clear irq --> %d\n", status); | 480 | dev_dbg(&spi->dev, "clear irq --> %d\n", status); |
@@ -627,8 +627,8 @@ static int ds1305_probe(struct spi_device *spi) | |||
627 | 627 | ||
628 | /* read and cache control registers */ | 628 | /* read and cache control registers */ |
629 | addr = DS1305_CONTROL; | 629 | addr = DS1305_CONTROL; |
630 | status = spi_write_then_read(spi, &addr, sizeof addr, | 630 | status = spi_write_then_read(spi, &addr, sizeof(addr), |
631 | ds1305->ctrl, sizeof ds1305->ctrl); | 631 | ds1305->ctrl, sizeof(ds1305->ctrl)); |
632 | if (status < 0) { | 632 | if (status < 0) { |
633 | dev_dbg(&spi->dev, "can't %s, %d\n", | 633 | dev_dbg(&spi->dev, "can't %s, %d\n", |
634 | "read", status); | 634 | "read", status); |
@@ -659,7 +659,7 @@ static int ds1305_probe(struct spi_device *spi) | |||
659 | 659 | ||
660 | buf[0] = DS1305_WRITE | DS1305_CONTROL; | 660 | buf[0] = DS1305_WRITE | DS1305_CONTROL; |
661 | buf[1] = ds1305->ctrl[0]; | 661 | buf[1] = ds1305->ctrl[0]; |
662 | status = spi_write_then_read(spi, buf, sizeof buf, NULL, 0); | 662 | status = spi_write_then_read(spi, buf, sizeof(buf), NULL, 0); |
663 | 663 | ||
664 | dev_dbg(&spi->dev, "clear WP --> %d\n", status); | 664 | dev_dbg(&spi->dev, "clear WP --> %d\n", status); |
665 | if (status < 0) | 665 | if (status < 0) |
@@ -713,7 +713,7 @@ static int ds1305_probe(struct spi_device *spi) | |||
713 | buf[1] = ds1305->ctrl[0]; | 713 | buf[1] = ds1305->ctrl[0]; |
714 | buf[2] = ds1305->ctrl[1]; | 714 | buf[2] = ds1305->ctrl[1]; |
715 | buf[3] = ds1305->ctrl[2]; | 715 | buf[3] = ds1305->ctrl[2]; |
716 | status = spi_write_then_read(spi, buf, sizeof buf, NULL, 0); | 716 | status = spi_write_then_read(spi, buf, sizeof(buf), NULL, 0); |
717 | if (status < 0) { | 717 | if (status < 0) { |
718 | dev_dbg(&spi->dev, "can't %s, %d\n", | 718 | dev_dbg(&spi->dev, "can't %s, %d\n", |
719 | "write", status); | 719 | "write", status); |
@@ -725,8 +725,8 @@ static int ds1305_probe(struct spi_device *spi) | |||
725 | 725 | ||
726 | /* see if non-Linux software set up AM/PM mode */ | 726 | /* see if non-Linux software set up AM/PM mode */ |
727 | addr = DS1305_HOUR; | 727 | addr = DS1305_HOUR; |
728 | status = spi_write_then_read(spi, &addr, sizeof addr, | 728 | status = spi_write_then_read(spi, &addr, sizeof(addr), |
729 | &value, sizeof value); | 729 | &value, sizeof(value)); |
730 | if (status < 0) { | 730 | if (status < 0) { |
731 | dev_dbg(&spi->dev, "read HOUR --> %d\n", status); | 731 | dev_dbg(&spi->dev, "read HOUR --> %d\n", status); |
732 | return status; | 732 | return status; |