Skip to content

Commit 1e574a6

Browse files
arndbkrzk
authored andcommitted
ARM: samsung: remove s3c_pm_debug_init()
On s3c24xx and s3c64xx, this is just a wrapper around s3c_pm_debug_init_uart(), but this function does not exist on s5pv210, which always uses an empty stub as CONFIG_SAMSUNG_ATAGS is normally not set. In a configuration that supports both s5pv210 and s3c64xx, we would always call the s3c64xx function, which is probably incorrect when running on s5pv210. Remove the function call completely on s5pv210 and skip the wrapper on s3c as a cleanup. As a side-effect, the s3c64xx behavior is now always the same, regardless of whether it is a DT-only configuration or both DT and ATAGS are supported for booting. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20200806182059.2431-11-krzk@kernel.org Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
1 parent 9089d7b commit 1e574a6

6 files changed

Lines changed: 6 additions & 22 deletions

File tree

‎arch/arm/mach-s3c24xx/include/mach/pm-core.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
static inline void s3c_pm_debug_init_uart(void)
1717
{
18+
#ifdef CONFIG_SAMSUNG_PM_DEBUG
1819
unsigned long tmp = __raw_readl(S3C2410_CLKCON);
1920

2021
/* re-start uart clocks */
@@ -24,6 +25,7 @@ static inline void s3c_pm_debug_init_uart(void)
2425

2526
__raw_writel(tmp, S3C2410_CLKCON);
2627
udelay(10);
28+
#endif
2729
}
2830

2931
static inline void s3c_pm_arch_prepare_irqs(void)

‎arch/arm/mach-s3c64xx/include/mach/pm-core.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
static inline void s3c_pm_debug_init_uart(void)
2222
{
23+
#ifdef CONFIG_SAMSUNG_PM_DEBUG
2324
u32 tmp = __raw_readl(S3C_PCLK_GATE);
2425

2526
/* As a note, since the S3C64XX UARTs generally have multiple
@@ -35,6 +36,7 @@ static inline void s3c_pm_debug_init_uart(void)
3536

3637
__raw_writel(tmp, S3C_PCLK_GATE);
3738
udelay(10);
39+
#endif
3840
}
3941

4042
static inline void s3c_pm_arch_prepare_irqs(void)

‎arch/arm/mach-s5pv210/pm.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ static int s5pv210_suspend_enter(suspend_state_t state)
9999
u32 eint_wakeup_mask = s5pv210_read_eint_wakeup_mask();
100100
int ret;
101101

102-
s3c_pm_debug_init();
103-
104102
S3C_PMDBG("%s: suspending the system...\n", __func__);
105103

106104
S3C_PMDBG("%s: wakeup masks: %08x,%08x\n", __func__,

‎arch/arm/plat-samsung/include/plat/pm-common.h‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,12 @@ struct pm_uart_save {
6969
*/
7070
extern void s3c_pm_dbg(const char *msg, ...);
7171

72-
/**
73-
* s3c_pm_debug_init() - suspend/resume low level debug initialization.
74-
* @base: Virtual base of UART to use for suspend/resume debugging.
75-
*
76-
* This function needs to be called before S3C_PMDBG() can be used, to set up
77-
* UART port base address and configuration.
78-
*/
79-
extern void s3c_pm_debug_init(void);
80-
8172
#define S3C_PMDBG(fmt...) s3c_pm_dbg(fmt)
8273

8374
extern void s3c_pm_save_uarts(void);
8475
extern void s3c_pm_restore_uarts(void);
8576
#else
8677
#define S3C_PMDBG(fmt...) pr_debug(fmt)
87-
#define s3c_pm_debug_init() do { } while (0)
8878

8979
static inline void s3c_pm_save_uarts(void) { }
9080
static inline void s3c_pm_restore_uarts(void) { }

‎arch/arm/plat-samsung/pm-debug.c‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <plat/pm.h>
2323
#include <mach/pm-core.h>
2424
#else
25-
static inline void s3c_pm_debug_init_uart(void) {}
2625
static inline void s3c_pm_arch_update_uart(void __iomem *regs,
2726
struct pm_uart_save *save) {}
2827
#endif
@@ -43,12 +42,6 @@ void s3c_pm_dbg(const char *fmt, ...)
4342
printascii(buff);
4443
}
4544

46-
void s3c_pm_debug_init(void)
47-
{
48-
/* restart uart clocks so we can use them to output */
49-
s3c_pm_debug_init_uart();
50-
}
51-
5245
static inline void __iomem *s3c_pm_uart_base(void)
5346
{
5447
unsigned long paddr;

‎arch/arm/plat-samsung/pm.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ static int s3c_pm_enter(suspend_state_t state)
7070
{
7171
int ret;
7272
/* ensure the debug is initialised (if enabled) */
73-
74-
s3c_pm_debug_init();
73+
s3c_pm_debug_init_uart();
7574

7675
S3C_PMDBG("%s(%d)\n", __func__, state);
7776

@@ -144,7 +143,7 @@ static int s3c_pm_enter(suspend_state_t state)
144143
s3c_pm_restored_gpios();
145144
}
146145

147-
s3c_pm_debug_init();
146+
s3c_pm_debug_init_uart();
148147

149148
/* check what irq (if any) restored the system */
150149

0 commit comments

Comments
 (0)