summaryrefslogtreecommitdiff
authorjiamin ma <jiamin.ma@amlogic.com>2018-04-18 00:37:52 (GMT)
committer Xindong Xu <xindong.xu@amlogic.com>2018-04-19 06:00:46 (GMT)
commit03cc19c2a2326f32b5fdca2024e1604025a6a0bd (patch)
tree0fff156538cb6bce5d7e9a6e33f4eb55e482523a
parent44f814c0d3b4776d8a5c6cda800cde0414271a68 (diff)
downloadcommon-03cc19c2a2326f32b5fdca2024e1604025a6a0bd.zip
common-03cc19c2a2326f32b5fdca2024e1604025a6a0bd.tar.gz
common-03cc19c2a2326f32b5fdca2024e1604025a6a0bd.tar.bz2
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>
Diffstat
-rw-r--r--drivers/amlogic/clk/clkc.h2
-rw-r--r--drivers/amlogic/ddr_tool/ddr_bandwidth.c7
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/amlogic/clk/clkc.h b/drivers/amlogic/clk/clkc.h
index 72dec81..f837065 100644
--- a/drivers/amlogic/clk/clkc.h
+++ b/drivers/amlogic/clk/clkc.h
@@ -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;
diff --git a/drivers/amlogic/ddr_tool/ddr_bandwidth.c b/drivers/amlogic/ddr_tool/ddr_bandwidth.c
index 8b8f9d7..002c6fa 100644
--- a/drivers/amlogic/ddr_tool/ddr_bandwidth.c
+++ b/drivers/amlogic/ddr_tool/ddr_bandwidth.c
@@ -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