ARM: 9314/1: tcm: move tcm_init() prototype to asm/tcm.h

The function definition is in a file that does not include the
header with the declaration:

arch/arm/kernel/tcm.c:256:13: error: no previous prototype for 'tcm_init'

Move the declaration to a global header where it can actually be
included.

Fixes: de40614e92 ("ARM: 7694/1: ARM, TCM: initialize TCM in paging_init(), instead of setup_arch()")
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
This commit is contained in:
Arnd Bergmann 2023-06-02 19:28:43 +01:00 committed by Russell King (Oracle)
parent a12f8586af
commit aecc83e506
3 changed files with 9 additions and 21 deletions

View File

@ -9,9 +9,7 @@
#ifndef __ASMARM_TCM_H
#define __ASMARM_TCM_H
#ifndef CONFIG_HAVE_TCM
#error "You should not be including tcm.h unless you have a TCM!"
#endif
#ifdef CONFIG_HAVE_TCM
#include <linux/compiler.h>
@ -29,4 +27,11 @@ void tcm_free(void *addr, size_t len);
bool tcm_dtcm_present(void);
bool tcm_itcm_present(void);
void __init tcm_init(void);
#else
/* No TCM support, just blank inlines to be optimized out */
static inline void tcm_init(void)
{
}
#endif
#endif

View File

@ -21,6 +21,7 @@
#include <asm/sections.h>
#include <asm/setup.h>
#include <asm/smp_plat.h>
#include <asm/tcm.h>
#include <asm/tlb.h>
#include <asm/highmem.h>
#include <asm/system_info.h>
@ -37,7 +38,6 @@
#include "fault.h"
#include "mm.h"
#include "tcm.h"
extern unsigned long __atags_pointer;

View File

@ -1,17 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (C) 2008-2009 ST-Ericsson AB
* TCM memory handling for ARM systems
*
* Author: Linus Walleij <linus.walleij@stericsson.com>
* Author: Rickard Andersson <rickard.andersson@stericsson.com>
*/
#ifdef CONFIG_HAVE_TCM
void __init tcm_init(void);
#else
/* No TCM support, just blank inlines to be optimized out */
static inline void tcm_init(void)
{
}
#endif