Commit d6db23c7 authored by Jean Delvare's avatar Jean Delvare Committed by Jean Delvare

hwmon: (coretemp) Add missing section annotations

Many functions in the coretemp driver lack a proper section
annotation. Add them to let the kernel free the memory after
initialization when possible.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: Durgadoss R <durgadoss.r@intel.com>
Acked-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
parent 6b101116
...@@ -190,7 +190,8 @@ static ssize_t show_temp(struct device *dev, ...@@ -190,7 +190,8 @@ static ssize_t show_temp(struct device *dev,
return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN; return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN;
} }
static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,
struct device *dev)
{ {
/* The 100C is default for both mobile and non mobile CPUs */ /* The 100C is default for both mobile and non mobile CPUs */
...@@ -284,7 +285,8 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) ...@@ -284,7 +285,8 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
return tjmax; return tjmax;
} }
static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) static int __cpuinit get_tjmax(struct cpuinfo_x86 *c, u32 id,
struct device *dev)
{ {
int err; int err;
u32 eax, edx; u32 eax, edx;
...@@ -323,7 +325,8 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) ...@@ -323,7 +325,8 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
return adjust_tjmax(c, id, dev); return adjust_tjmax(c, id, dev);
} }
static int create_name_attr(struct platform_data *pdata, struct device *dev) static int __devinit create_name_attr(struct platform_data *pdata,
struct device *dev)
{ {
sysfs_attr_init(&pdata->name_attr.attr); sysfs_attr_init(&pdata->name_attr.attr);
pdata->name_attr.attr.name = "name"; pdata->name_attr.attr.name = "name";
...@@ -332,8 +335,8 @@ static int create_name_attr(struct platform_data *pdata, struct device *dev) ...@@ -332,8 +335,8 @@ static int create_name_attr(struct platform_data *pdata, struct device *dev)
return device_create_file(dev, &pdata->name_attr); return device_create_file(dev, &pdata->name_attr);
} }
static int create_core_attrs(struct temp_data *tdata, struct device *dev, static int __cpuinit create_core_attrs(struct temp_data *tdata,
int attr_no) struct device *dev, int attr_no)
{ {
int err, i; int err, i;
static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev, static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev,
...@@ -383,7 +386,7 @@ static int __cpuinit chk_ucode_version(unsigned int cpu) ...@@ -383,7 +386,7 @@ static int __cpuinit chk_ucode_version(unsigned int cpu)
return 0; return 0;
} }
static struct platform_device *coretemp_get_pdev(unsigned int cpu) static struct platform_device __cpuinit *coretemp_get_pdev(unsigned int cpu)
{ {
u16 phys_proc_id = TO_PHYS_ID(cpu); u16 phys_proc_id = TO_PHYS_ID(cpu);
struct pdev_entry *p; struct pdev_entry *p;
...@@ -400,7 +403,8 @@ static struct platform_device *coretemp_get_pdev(unsigned int cpu) ...@@ -400,7 +403,8 @@ static struct platform_device *coretemp_get_pdev(unsigned int cpu)
return NULL; return NULL;
} }
static struct temp_data *init_temp_data(unsigned int cpu, int pkg_flag) static struct temp_data __cpuinit *init_temp_data(unsigned int cpu,
int pkg_flag)
{ {
struct temp_data *tdata; struct temp_data *tdata;
...@@ -418,7 +422,7 @@ static struct temp_data *init_temp_data(unsigned int cpu, int pkg_flag) ...@@ -418,7 +422,7 @@ static struct temp_data *init_temp_data(unsigned int cpu, int pkg_flag)
return tdata; return tdata;
} }
static int create_core_data(struct platform_device *pdev, static int __cpuinit create_core_data(struct platform_device *pdev,
unsigned int cpu, int pkg_flag) unsigned int cpu, int pkg_flag)
{ {
struct temp_data *tdata; struct temp_data *tdata;
...@@ -489,7 +493,7 @@ static int create_core_data(struct platform_device *pdev, ...@@ -489,7 +493,7 @@ static int create_core_data(struct platform_device *pdev,
return err; return err;
} }
static void coretemp_add_core(unsigned int cpu, int pkg_flag) static void __cpuinit coretemp_add_core(unsigned int cpu, int pkg_flag)
{ {
struct platform_device *pdev = coretemp_get_pdev(cpu); struct platform_device *pdev = coretemp_get_pdev(cpu);
int err; int err;
...@@ -618,7 +622,7 @@ static int __cpuinit coretemp_device_add(unsigned int cpu) ...@@ -618,7 +622,7 @@ static int __cpuinit coretemp_device_add(unsigned int cpu)
return err; return err;
} }
static void coretemp_device_remove(unsigned int cpu) static void __cpuinit coretemp_device_remove(unsigned int cpu)
{ {
struct pdev_entry *p, *n; struct pdev_entry *p, *n;
u16 phys_proc_id = TO_PHYS_ID(cpu); u16 phys_proc_id = TO_PHYS_ID(cpu);
...@@ -634,7 +638,7 @@ static void coretemp_device_remove(unsigned int cpu) ...@@ -634,7 +638,7 @@ static void coretemp_device_remove(unsigned int cpu)
mutex_unlock(&pdev_list_mutex); mutex_unlock(&pdev_list_mutex);
} }
static bool is_any_core_online(struct platform_data *pdata) static bool __cpuinit is_any_core_online(struct platform_data *pdata)
{ {
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment