Skip to content

Commit

Permalink
ARM: integrator: fix build with INTEGRATOR_AP off
Browse files Browse the repository at this point in the history
The conditional declaration of ap_uart_data is broken
and causes this build error:

In file included from arch/arm/mach-integrator/core.c:35:0:
arch/arm/mach-integrator/common.h:6:37: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token

Turning the check into an constant-expression if(IS_ENABLED()) statement
creates more readable code and solves this problem as well.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Russell King <linux@arm.linux.org.uk>
  • Loading branch information
Arnd Bergmann committed Feb 14, 2013
1 parent 060fd1b commit a02e0a8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions arch/arm/mach-integrator/common.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#include <linux/amba/serial.h>
#ifdef CONFIG_ARCH_INTEGRATOR_AP
extern struct amba_pl010_data ap_uart_data;
#else
/* Not used without Integrator/AP support anyway */
struct amba_pl010_data ap_uart_data {};
#endif
void integrator_init_early(void);
int integrator_init(bool is_cp);
void integrator_reserve(void);
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-integrator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int __init integrator_init(bool is_cp)
* hard-code them. The Integator/CP and forward have proper cell IDs.
* Else we leave them undefined to the bus driver can autoprobe them.
*/
if (!is_cp) {
if (!is_cp && IS_ENABLED(CONFIG_ARCH_INTEGRATOR_AP)) {
rtc_device.periphid = 0x00041030;
uart0_device.periphid = 0x00041010;
uart1_device.periphid = 0x00041010;
Expand Down

0 comments on commit a02e0a8

Please sign in to comment.