Message ID | 20180316100205.GA26372@lenoch (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On 16/03/2018 at 11:02, Ladislav Michl wrote: > Use dev_info() instead of pr_info(). > > Signed-off-by: Ladislav Michl <ladis@linux-mips.org> > --- > Hi, > > I took a chance to constify and move reason variable in one patch. > If you do think it should be a separate patch, let me know. It's okay: Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> > > drivers/power/reset/at91-poweroff.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/power/reset/at91-poweroff.c b/drivers/power/reset/at91-poweroff.c > index c30c40193aaa..f8f88798cb66 100644 > --- a/drivers/power/reset/at91-poweroff.c > +++ b/drivers/power/reset/at91-poweroff.c > @@ -55,10 +55,10 @@ static void __iomem *at91_shdwc_base; > static struct clk *sclk; > static void __iomem *mpddrc_base; > > -static void __init at91_wakeup_status(void) > +static void __init at91_wakeup_status(struct platform_device *pdev) > { > + const char *reason; > u32 reg = readl(at91_shdwc_base + AT91_SHDW_SR); > - char *reason = "unknown"; > > /* Simple power-on, just bail out */ > if (!reg) > @@ -68,8 +68,10 @@ static void __init at91_wakeup_status(void) > reason = "RTT"; > else if (reg & AT91_SHDW_RTCWK) > reason = "RTC"; > + else > + reason = "unknown"; > > - pr_info("AT91: Wake-Up source: %s\n", reason); > + dev_info(&pdev->dev, "Wake-Up source: %s\n", reason); > } > > static void at91_poweroff(void) > @@ -172,7 +174,7 @@ static int __init at91_poweroff_probe(struct platform_device *pdev) > return ret; > } > > - at91_wakeup_status(); > + at91_wakeup_status(pdev); > > if (pdev->dev.of_node) > at91_poweroff_dt_set_wakeup_mode(pdev); >
diff --git a/drivers/power/reset/at91-poweroff.c b/drivers/power/reset/at91-poweroff.c index c30c40193aaa..f8f88798cb66 100644 --- a/drivers/power/reset/at91-poweroff.c +++ b/drivers/power/reset/at91-poweroff.c @@ -55,10 +55,10 @@ static void __iomem *at91_shdwc_base; static struct clk *sclk; static void __iomem *mpddrc_base; -static void __init at91_wakeup_status(void) +static void __init at91_wakeup_status(struct platform_device *pdev) { + const char *reason; u32 reg = readl(at91_shdwc_base + AT91_SHDW_SR); - char *reason = "unknown"; /* Simple power-on, just bail out */ if (!reg) @@ -68,8 +68,10 @@ static void __init at91_wakeup_status(void) reason = "RTT"; else if (reg & AT91_SHDW_RTCWK) reason = "RTC"; + else + reason = "unknown"; - pr_info("AT91: Wake-Up source: %s\n", reason); + dev_info(&pdev->dev, "Wake-Up source: %s\n", reason); } static void at91_poweroff(void) @@ -172,7 +174,7 @@ static int __init at91_poweroff_probe(struct platform_device *pdev) return ret; } - at91_wakeup_status(); + at91_wakeup_status(pdev); if (pdev->dev.of_node) at91_poweroff_dt_set_wakeup_mode(pdev);
Use dev_info() instead of pr_info(). Signed-off-by: Ladislav Michl <ladis@linux-mips.org> --- Hi, I took a chance to constify and move reason variable in one patch. If you do think it should be a separate patch, let me know. drivers/power/reset/at91-poweroff.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)