diff options
author | Jean Delvare <khali@linux-fr.org> | 2012-01-16 16:51:47 -0500 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2012-01-16 16:51:47 -0500 |
commit | d6db23c7ce8d02896197394c1d741bdffe58ac54 (patch) | |
tree | 8382f3907f04f29bb5bca9ce4e93a30b32b7f5be /drivers | |
parent | 6b101116ae445311031f3e9f91d3010d444b9845 (diff) |
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: Jean Delvare <khali@linux-fr.org>
Cc: Durgadoss R <durgadoss.r@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/coretemp.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 1fdef885341c..a6c6ec36615e 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
@@ -190,7 +190,8 @@ static ssize_t show_temp(struct device *dev, | |||
190 | return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN; | 190 | return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN; |
191 | } | 191 | } |
192 | 192 | ||
193 | static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) | 193 | static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, |
194 | struct device *dev) | ||
194 | { | 195 | { |
195 | /* The 100C is default for both mobile and non mobile CPUs */ | 196 | /* The 100C is default for both mobile and non mobile CPUs */ |
196 | 197 | ||
@@ -284,7 +285,8 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) | |||
284 | return tjmax; | 285 | return tjmax; |
285 | } | 286 | } |
286 | 287 | ||
287 | static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) | 288 | static int __cpuinit get_tjmax(struct cpuinfo_x86 *c, u32 id, |
289 | struct device *dev) | ||
288 | { | 290 | { |
289 | int err; | 291 | int err; |
290 | u32 eax, edx; | 292 | u32 eax, edx; |
@@ -323,7 +325,8 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) | |||
323 | return adjust_tjmax(c, id, dev); | 325 | return adjust_tjmax(c, id, dev); |
324 | } | 326 | } |
325 | 327 | ||
326 | static int create_name_attr(struct platform_data *pdata, struct device *dev) | 328 | static int __devinit create_name_attr(struct platform_data *pdata, |
329 | struct device *dev) | ||
327 | { | 330 | { |
328 | sysfs_attr_init(&pdata->name_attr.attr); | 331 | sysfs_attr_init(&pdata->name_attr.attr); |
329 | pdata->name_attr.attr.name = "name"; | 332 | pdata->name_attr.attr.name = "name"; |
@@ -332,8 +335,8 @@ static int create_name_attr(struct platform_data *pdata, struct device *dev) | |||
332 | return device_create_file(dev, &pdata->name_attr); | 335 | return device_create_file(dev, &pdata->name_attr); |
333 | } | 336 | } |
334 | 337 | ||
335 | static int create_core_attrs(struct temp_data *tdata, struct device *dev, | 338 | static int __cpuinit create_core_attrs(struct temp_data *tdata, |
336 | int attr_no) | 339 | struct device *dev, int attr_no) |
337 | { | 340 | { |
338 | int err, i; | 341 | int err, i; |
339 | static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev, | 342 | 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 | return 0; | 386 | return 0; |
384 | } | 387 | } |
385 | 388 | ||
386 | static struct platform_device *coretemp_get_pdev(unsigned int cpu) | 389 | static struct platform_device __cpuinit *coretemp_get_pdev(unsigned int cpu) |
387 | { | 390 | { |
388 | u16 phys_proc_id = TO_PHYS_ID(cpu); | 391 | u16 phys_proc_id = TO_PHYS_ID(cpu); |
389 | struct pdev_entry *p; | 392 | struct pdev_entry *p; |
@@ -400,7 +403,8 @@ static struct platform_device *coretemp_get_pdev(unsigned int cpu) | |||
400 | return NULL; | 403 | return NULL; |
401 | } | 404 | } |
402 | 405 | ||
403 | static struct temp_data *init_temp_data(unsigned int cpu, int pkg_flag) | 406 | static struct temp_data __cpuinit *init_temp_data(unsigned int cpu, |
407 | int pkg_flag) | ||
404 | { | 408 | { |
405 | struct temp_data *tdata; | 409 | struct temp_data *tdata; |
406 | 410 | ||
@@ -418,7 +422,7 @@ static struct temp_data *init_temp_data(unsigned int cpu, int pkg_flag) | |||
418 | return tdata; | 422 | return tdata; |
419 | } | 423 | } |
420 | 424 | ||
421 | static int create_core_data(struct platform_device *pdev, | 425 | static int __cpuinit create_core_data(struct platform_device *pdev, |
422 | unsigned int cpu, int pkg_flag) | 426 | unsigned int cpu, int pkg_flag) |
423 | { | 427 | { |
424 | struct temp_data *tdata; | 428 | struct temp_data *tdata; |
@@ -489,7 +493,7 @@ exit_free: | |||
489 | return err; | 493 | return err; |
490 | } | 494 | } |
491 | 495 | ||
492 | static void coretemp_add_core(unsigned int cpu, int pkg_flag) | 496 | static void __cpuinit coretemp_add_core(unsigned int cpu, int pkg_flag) |
493 | { | 497 | { |
494 | struct platform_device *pdev = coretemp_get_pdev(cpu); | 498 | struct platform_device *pdev = coretemp_get_pdev(cpu); |
495 | int err; | 499 | int err; |
@@ -618,7 +622,7 @@ exit: | |||
618 | return err; | 622 | return err; |
619 | } | 623 | } |
620 | 624 | ||
621 | static void coretemp_device_remove(unsigned int cpu) | 625 | static void __cpuinit coretemp_device_remove(unsigned int cpu) |
622 | { | 626 | { |
623 | struct pdev_entry *p, *n; | 627 | struct pdev_entry *p, *n; |
624 | u16 phys_proc_id = TO_PHYS_ID(cpu); | 628 | u16 phys_proc_id = TO_PHYS_ID(cpu); |
@@ -634,7 +638,7 @@ static void coretemp_device_remove(unsigned int cpu) | |||
634 | mutex_unlock(&pdev_list_mutex); | 638 | mutex_unlock(&pdev_list_mutex); |
635 | } | 639 | } |
636 | 640 | ||
637 | static bool is_any_core_online(struct platform_data *pdata) | 641 | static bool __cpuinit is_any_core_online(struct platform_data *pdata) |
638 | { | 642 | { |
639 | int i; | 643 | int i; |
640 | 644 | ||