Commit 07ae9278 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Alexandre Belloni

rtc: mpfs: Remove printing of stray CR

During boot, the driver prints out a stray carriage return character.
Remove it, together with the preceding space character.

While at it, change prescaler to "unsigned long", as returned by
clk_get_rate(), to avoid truncating very large clock rates, and update
the format specifiers.

Fixes: 0b31d703 ("rtc: Add driver for Microchip PolarFire SoC")
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: default avatarConor Dooley <conor.dooley@microchip.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/bce2ca405ef96b1363fd1370887409d9e8468422.1660659437.git.geert+renesas@glider.be
parent 568035b0
...@@ -233,7 +233,7 @@ static int mpfs_rtc_probe(struct platform_device *pdev) ...@@ -233,7 +233,7 @@ static int mpfs_rtc_probe(struct platform_device *pdev)
{ {
struct mpfs_rtc_dev *rtcdev; struct mpfs_rtc_dev *rtcdev;
struct clk *clk; struct clk *clk;
u32 prescaler; unsigned long prescaler;
int wakeup_irq, ret; int wakeup_irq, ret;
rtcdev = devm_kzalloc(&pdev->dev, sizeof(struct mpfs_rtc_dev), GFP_KERNEL); rtcdev = devm_kzalloc(&pdev->dev, sizeof(struct mpfs_rtc_dev), GFP_KERNEL);
...@@ -275,14 +275,13 @@ static int mpfs_rtc_probe(struct platform_device *pdev) ...@@ -275,14 +275,13 @@ static int mpfs_rtc_probe(struct platform_device *pdev)
/* prescaler hardware adds 1 to reg value */ /* prescaler hardware adds 1 to reg value */
prescaler = clk_get_rate(devm_clk_get(&pdev->dev, "rtcref")) - 1; prescaler = clk_get_rate(devm_clk_get(&pdev->dev, "rtcref")) - 1;
if (prescaler > MAX_PRESCALER_COUNT) { if (prescaler > MAX_PRESCALER_COUNT) {
dev_dbg(&pdev->dev, "invalid prescaler %d\n", prescaler); dev_dbg(&pdev->dev, "invalid prescaler %lu\n", prescaler);
return -EINVAL; return -EINVAL;
} }
writel(prescaler, rtcdev->base + PRESCALER_REG); writel(prescaler, rtcdev->base + PRESCALER_REG);
dev_info(&pdev->dev, "prescaler set to: 0x%X \r\n", prescaler); dev_info(&pdev->dev, "prescaler set to: %lu\n", prescaler);
device_init_wakeup(&pdev->dev, true); device_init_wakeup(&pdev->dev, true);
ret = dev_pm_set_wake_irq(&pdev->dev, wakeup_irq); ret = dev_pm_set_wake_irq(&pdev->dev, wakeup_irq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment