[PATCH 21/28] at91: debug_ll: remove duplicated IS_ENABLED(CONFIG_DEBUG_LL) condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There are three users of at91_dbgu_setup_ll and all already call this
function only when IS_ENABLED(CONFIG_DEBUG_LL). Remove the duplicated
condition from the function itself. This allows us to use the function
for pbl_set_console use later on, even with DEBUG_LL disabled.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 arch/arm/mach-at91/include/mach/at91_dbgu.h | 34 ++++++++++-----------
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-at91/include/mach/at91_dbgu.h b/arch/arm/mach-at91/include/mach/at91_dbgu.h
index 0ba9cdae10ce..29aaa2dfe154 100644
--- a/arch/arm/mach-at91/include/mach/at91_dbgu.h
+++ b/arch/arm/mach-at91/include/mach/at91_dbgu.h
@@ -94,30 +94,28 @@ static inline void at91_dbgu_setup_ll(void __iomem *dbgu_base,
 				      unsigned mck,
 				      unsigned baudrate)
 {
-	if (IS_ENABLED(CONFIG_DEBUG_LL)) {
-		u32 brgr = mck / (baudrate * 16);
+	u32 brgr = mck / (baudrate * 16);
 
-		if ((mck / (baudrate * 16)) % 10 >= 5)
-			brgr++;
+	if ((mck / (baudrate * 16)) % 10 >= 5)
+		brgr++;
 
-		writel(~0, dbgu_base + AT91_DBGU_IDR);
+	writel(~0, dbgu_base + AT91_DBGU_IDR);
 
-		writel(AT91_DBGU_RSTRX
-		       | AT91_DBGU_RSTTX
-		       | AT91_DBGU_RXDIS
-		       | AT91_DBGU_TXDIS,
-		       dbgu_base + AT91_DBGU_CR);
+	writel(AT91_DBGU_RSTRX
+	       | AT91_DBGU_RSTTX
+	       | AT91_DBGU_RXDIS
+	       | AT91_DBGU_TXDIS,
+	       dbgu_base + AT91_DBGU_CR);
 
-		writel(brgr, dbgu_base + AT91_DBGU_BRGR);
+	writel(brgr, dbgu_base + AT91_DBGU_BRGR);
 
-		writel(AT91_DBGU_PAR_NONE
-		       | AT91_DBGU_CHMODE_NORMAL
-		       | AT91_DBGU_CHRL_8BIT
-		       | AT91_DBGU_NBSTOP_1BIT,
-		       dbgu_base + AT91_DBGU_MR);
+	writel(AT91_DBGU_PAR_NONE
+	       | AT91_DBGU_CHMODE_NORMAL
+	       | AT91_DBGU_CHRL_8BIT
+	       | AT91_DBGU_NBSTOP_1BIT,
+	       dbgu_base + AT91_DBGU_MR);
 
-		writel(AT91_DBGU_RXEN | AT91_DBGU_TXEN, dbgu_base + AT91_DBGU_CR);
-	}
+	writel(AT91_DBGU_RXEN | AT91_DBGU_TXEN, dbgu_base + AT91_DBGU_CR);
 }
 
 #endif
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux