diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-02-21 19:44:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 20:22:27 -0500 |
commit | 01a4ca16c897882635c937bf8f967584883669a2 (patch) | |
tree | 8f2a00282317b0c75726ac44560b450e05bfd3c6 /drivers/rtc | |
parent | d7d48f6216686602e6e3d8470563326605b01c95 (diff) |
drivers/rtc: dump small buffers via %*ph
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r-- | drivers/rtc/rtc-ds1305.c | 8 | ||||
-rw-r--r-- | drivers/rtc/rtc-ds1307.c | 11 | ||||
-rw-r--r-- | drivers/rtc/rtc-fm3130.c | 33 |
3 files changed, 8 insertions, 44 deletions
diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index d578773f5ce2..b05a6dc96405 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c | |||
@@ -635,9 +635,7 @@ static int ds1305_probe(struct spi_device *spi) | |||
635 | goto fail0; | 635 | goto fail0; |
636 | } | 636 | } |
637 | 637 | ||
638 | dev_dbg(&spi->dev, "ctrl %s: %02x %02x %02x\n", | 638 | dev_dbg(&spi->dev, "ctrl %s: %3ph\n", "read", ds1305->ctrl); |
639 | "read", ds1305->ctrl[0], | ||
640 | ds1305->ctrl[1], ds1305->ctrl[2]); | ||
641 | 639 | ||
642 | /* Sanity check register values ... partially compensating for the | 640 | /* Sanity check register values ... partially compensating for the |
643 | * fact that SPI has no device handshake. A pullup on MISO would | 641 | * fact that SPI has no device handshake. A pullup on MISO would |
@@ -723,9 +721,7 @@ static int ds1305_probe(struct spi_device *spi) | |||
723 | goto fail0; | 721 | goto fail0; |
724 | } | 722 | } |
725 | 723 | ||
726 | dev_dbg(&spi->dev, "ctrl %s: %02x %02x %02x\n", | 724 | dev_dbg(&spi->dev, "ctrl %s: %3ph\n", "write", ds1305->ctrl); |
727 | "write", ds1305->ctrl[0], | ||
728 | ds1305->ctrl[1], ds1305->ctrl[2]); | ||
729 | } | 725 | } |
730 | 726 | ||
731 | /* see if non-Linux software set up AM/PM mode */ | 727 | /* see if non-Linux software set up AM/PM mode */ |
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index e0d0ba4de03f..970a236b147a 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c | |||
@@ -322,12 +322,7 @@ static int ds1307_get_time(struct device *dev, struct rtc_time *t) | |||
322 | return -EIO; | 322 | return -EIO; |
323 | } | 323 | } |
324 | 324 | ||
325 | dev_dbg(dev, "%s: %02x %02x %02x %02x %02x %02x %02x\n", | 325 | dev_dbg(dev, "%s: %7ph\n", "read", ds1307->regs); |
326 | "read", | ||
327 | ds1307->regs[0], ds1307->regs[1], | ||
328 | ds1307->regs[2], ds1307->regs[3], | ||
329 | ds1307->regs[4], ds1307->regs[5], | ||
330 | ds1307->regs[6]); | ||
331 | 326 | ||
332 | t->tm_sec = bcd2bin(ds1307->regs[DS1307_REG_SECS] & 0x7f); | 327 | t->tm_sec = bcd2bin(ds1307->regs[DS1307_REG_SECS] & 0x7f); |
333 | t->tm_min = bcd2bin(ds1307->regs[DS1307_REG_MIN] & 0x7f); | 328 | t->tm_min = bcd2bin(ds1307->regs[DS1307_REG_MIN] & 0x7f); |
@@ -398,9 +393,7 @@ static int ds1307_set_time(struct device *dev, struct rtc_time *t) | |||
398 | break; | 393 | break; |
399 | } | 394 | } |
400 | 395 | ||
401 | dev_dbg(dev, "%s: %02x %02x %02x %02x %02x %02x %02x\n", | 396 | dev_dbg(dev, "%s: %7ph\n", "write", buf); |
402 | "write", buf[0], buf[1], buf[2], buf[3], | ||
403 | buf[4], buf[5], buf[6]); | ||
404 | 397 | ||
405 | result = ds1307->write_block_data(ds1307->client, | 398 | result = ds1307->write_block_data(ds1307->client, |
406 | ds1307->offset, 7, buf); | 399 | ds1307->offset, 7, buf); |
diff --git a/drivers/rtc/rtc-fm3130.c b/drivers/rtc/rtc-fm3130.c index 04e93c6597f8..bff3cdc5140e 100644 --- a/drivers/rtc/rtc-fm3130.c +++ b/drivers/rtc/rtc-fm3130.c | |||
@@ -116,17 +116,7 @@ static int fm3130_get_time(struct device *dev, struct rtc_time *t) | |||
116 | 116 | ||
117 | fm3130_rtc_mode(dev, FM3130_MODE_NORMAL); | 117 | fm3130_rtc_mode(dev, FM3130_MODE_NORMAL); |
118 | 118 | ||
119 | dev_dbg(dev, "%s: %02x %02x %02x %02x %02x %02x %02x %02x" | 119 | dev_dbg(dev, "%s: %15ph\n", "read", fm3130->regs); |
120 | "%02x %02x %02x %02x %02x %02x %02x\n", | ||
121 | "read", | ||
122 | fm3130->regs[0], fm3130->regs[1], | ||
123 | fm3130->regs[2], fm3130->regs[3], | ||
124 | fm3130->regs[4], fm3130->regs[5], | ||
125 | fm3130->regs[6], fm3130->regs[7], | ||
126 | fm3130->regs[8], fm3130->regs[9], | ||
127 | fm3130->regs[0xa], fm3130->regs[0xb], | ||
128 | fm3130->regs[0xc], fm3130->regs[0xd], | ||
129 | fm3130->regs[0xe]); | ||
130 | 120 | ||
131 | t->tm_sec = bcd2bin(fm3130->regs[FM3130_RTC_SECONDS] & 0x7f); | 121 | t->tm_sec = bcd2bin(fm3130->regs[FM3130_RTC_SECONDS] & 0x7f); |
132 | t->tm_min = bcd2bin(fm3130->regs[FM3130_RTC_MINUTES] & 0x7f); | 122 | t->tm_min = bcd2bin(fm3130->regs[FM3130_RTC_MINUTES] & 0x7f); |
@@ -175,12 +165,7 @@ static int fm3130_set_time(struct device *dev, struct rtc_time *t) | |||
175 | tmp = t->tm_year - 100; | 165 | tmp = t->tm_year - 100; |
176 | buf[FM3130_RTC_YEARS] = bin2bcd(tmp); | 166 | buf[FM3130_RTC_YEARS] = bin2bcd(tmp); |
177 | 167 | ||
178 | dev_dbg(dev, "%s: %02x %02x %02x %02x %02x %02x %02x" | 168 | dev_dbg(dev, "%s: %15ph\n", "write", buf); |
179 | "%02x %02x %02x %02x %02x %02x %02x %02x\n", | ||
180 | "write", buf[0], buf[1], buf[2], buf[3], | ||
181 | buf[4], buf[5], buf[6], buf[7], | ||
182 | buf[8], buf[9], buf[0xa], buf[0xb], | ||
183 | buf[0xc], buf[0xd], buf[0xe]); | ||
184 | 169 | ||
185 | fm3130_rtc_mode(dev, FM3130_MODE_WRITE); | 170 | fm3130_rtc_mode(dev, FM3130_MODE_WRITE); |
186 | 171 | ||
@@ -517,18 +502,8 @@ bad_alarm: | |||
517 | bad_clock: | 502 | bad_clock: |
518 | 503 | ||
519 | if (!fm3130->data_valid || !fm3130->alarm_valid) | 504 | if (!fm3130->data_valid || !fm3130->alarm_valid) |
520 | dev_dbg(&client->dev, | 505 | dev_dbg(&client->dev, "%s: %15ph\n", "bogus registers", |
521 | "%s: %02x %02x %02x %02x %02x %02x %02x %02x" | 506 | fm3130->regs); |
522 | "%02x %02x %02x %02x %02x %02x %02x\n", | ||
523 | "bogus registers", | ||
524 | fm3130->regs[0], fm3130->regs[1], | ||
525 | fm3130->regs[2], fm3130->regs[3], | ||
526 | fm3130->regs[4], fm3130->regs[5], | ||
527 | fm3130->regs[6], fm3130->regs[7], | ||
528 | fm3130->regs[8], fm3130->regs[9], | ||
529 | fm3130->regs[0xa], fm3130->regs[0xb], | ||
530 | fm3130->regs[0xc], fm3130->regs[0xd], | ||
531 | fm3130->regs[0xe]); | ||
532 | 507 | ||
533 | /* We won't bail out here because we just got invalid data. | 508 | /* We won't bail out here because we just got invalid data. |
534 | Time setting from u-boot doesn't work anyway */ | 509 | Time setting from u-boot doesn't work anyway */ |