defect: fix section mismatch warning

PD#164617: section mismatch warning

When a variable or function with __initxxx anotation refers a
variable or function without it, there will be a section mismatch
warning.
In such case, memory belong to the latter will be released after
kernel booting up, if the former still refers the latter, strange
things happens
So we have to use __initxxx anotations correctly or add __refxxx
anotations to teach modpost that it is okay and save to use __init
anotations in this way.

Change-Id: Ic97dac8998b2a01c82dd7a3bae12fa9c7a113bc4
Signed-off-by: jiamin ma <jiamin.ma@amlogic.com>
This commit is contained in:
jiamin ma
2018-04-18 08:37:52 +08:00
committed by Yixun Lan
parent bcfcd94eb1
commit 23fdd53d97
2 changed files with 7 additions and 2 deletions

View File

@@ -33,7 +33,7 @@
#define MESON_PARM_APPLICABLE(p) (!!((p)->width))
#define PNAME(x) \
static const char *x[] __initconst
static const char *x[]
struct parm {
u16 reg_off;

View File

@@ -241,7 +241,12 @@ static struct class aml_ddr_class = {
.class_attrs = aml_ddr_tool_attr,
};
static int ddr_bandwidth_probe(struct platform_device *pdev)
/*
* ddr_bandwidth_probe only executes before the init process starts
* to run, so add __ref to indicate it is okay to call __init function
* ddr_find_port_desc
*/
static int __ref ddr_bandwidth_probe(struct platform_device *pdev)
{
int r = 0;
#ifdef CONFIG_OF