From 1093d32d90638cd663c58b59108346f53d681c40 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Mon, 6 Feb 2012 08:17:11 -0800 Subject: [PATCH] --- yaml --- r: 298047 b: refs/heads/master c: 2815ab92ba3ab27556212cc306288dc95692824b h: refs/heads/master i: 298045: 9901a17c7be3f9496ac36a4cc4fa328c12b0a948 298043: c55d9ea80023c7c159d634c7cf90fc11fc8d62f8 298039: d28dfff1c6879ee63cd4a539838f40f771ebc58c 298031: 597859e8b208ce24f8948b06c101c0c70c97664d 298015: 97bf5f8aee8e732fc169bbe6a5d583b6b827a526 297983: d5e8fd9d018f67f73074084493d68fdac49916ae v: v3 --- [refs] | 2 +- trunk/drivers/acpi/processor_thermal.c | 45 +++- trunk/drivers/acpi/processor_throttling.c | 5 +- trunk/drivers/acpi/thermal.c | 8 +- trunk/drivers/platform/x86/intel_ips.c | 13 +- trunk/drivers/thermal/Kconfig | 8 - trunk/drivers/thermal/Makefile | 1 - trunk/drivers/thermal/spear_thermal.c | 206 ------------------ trunk/drivers/thermal/thermal_sys.c | 94 ++++---- .../linux/platform_data/spear_thermal.h | 26 --- 10 files changed, 111 insertions(+), 297 deletions(-) delete mode 100644 trunk/drivers/thermal/spear_thermal.c delete mode 100644 trunk/include/linux/platform_data/spear_thermal.h diff --git a/[refs] b/[refs] index ffd17237f4fc..ba3d07a8dd83 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 344e222edf486bf42da1ced137e36df7a345b0ad +refs/heads/master: 2815ab92ba3ab27556212cc306288dc95692824b diff --git a/trunk/drivers/acpi/processor_thermal.c b/trunk/drivers/acpi/processor_thermal.c index 3b599abf2b40..641b5450a0db 100644 --- a/trunk/drivers/acpi/processor_thermal.c +++ b/trunk/drivers/acpi/processor_thermal.c @@ -57,6 +57,27 @@ ACPI_MODULE_NAME("processor_thermal"); static DEFINE_PER_CPU(unsigned int, cpufreq_thermal_reduction_pctg); static unsigned int acpi_thermal_cpufreq_is_init = 0; +#define reduction_pctg(cpu) \ + per_cpu(cpufreq_thermal_reduction_pctg, phys_package_first_cpu(cpu)) + +/* + * Emulate "per package data" using per cpu data (which should really be + * provided elsewhere) + * + * Note we can lose a CPU on cpu hotunplug, in this case we forget the state + * temporarily. Fortunately that's not a big issue here (I hope) + */ +static int phys_package_first_cpu(int cpu) +{ + int i; + int id = topology_physical_package_id(cpu); + + for_each_online_cpu(i) + if (topology_physical_package_id(i) == id) + return i; + return 0; +} + static int cpu_has_cpufreq(unsigned int cpu) { struct cpufreq_policy policy; @@ -76,7 +97,7 @@ static int acpi_thermal_cpufreq_notifier(struct notifier_block *nb, max_freq = ( policy->cpuinfo.max_freq * - (100 - per_cpu(cpufreq_thermal_reduction_pctg, policy->cpu) * 20) + (100 - reduction_pctg(policy->cpu) * 20) ) / 100; cpufreq_verify_within_limits(policy, 0, max_freq); @@ -102,16 +123,28 @@ static int cpufreq_get_cur_state(unsigned int cpu) if (!cpu_has_cpufreq(cpu)) return 0; - return per_cpu(cpufreq_thermal_reduction_pctg, cpu); + return reduction_pctg(cpu); } static int cpufreq_set_cur_state(unsigned int cpu, int state) { + int i; + if (!cpu_has_cpufreq(cpu)) return 0; - per_cpu(cpufreq_thermal_reduction_pctg, cpu) = state; - cpufreq_update_policy(cpu); + reduction_pctg(cpu) = state; + + /* + * Update all the CPUs in the same package because they all + * contribute to the temperature and often share the same + * frequency. + */ + for_each_online_cpu(i) { + if (topology_physical_package_id(i) == + topology_physical_package_id(cpu)) + cpufreq_update_policy(i); + } return 0; } @@ -119,10 +152,6 @@ void acpi_thermal_cpufreq_init(void) { int i; - for (i = 0; i < nr_cpu_ids; i++) - if (cpu_present(i)) - per_cpu(cpufreq_thermal_reduction_pctg, i) = 0; - i = cpufreq_register_notifier(&acpi_thermal_cpufreq_notifier_block, CPUFREQ_POLICY_NOTIFIER); if (!i) diff --git a/trunk/drivers/acpi/processor_throttling.c b/trunk/drivers/acpi/processor_throttling.c index 1d02b7b5ade0..605a2954ef17 100644 --- a/trunk/drivers/acpi/processor_throttling.c +++ b/trunk/drivers/acpi/processor_throttling.c @@ -769,7 +769,7 @@ static int acpi_read_throttling_status(struct acpi_processor *pr, u64 *value) { u32 bit_width, bit_offset; - u32 ptc_value; + u64 ptc_value; u64 ptc_mask; struct acpi_processor_throttling *throttling; int ret = -1; @@ -777,11 +777,12 @@ static int acpi_read_throttling_status(struct acpi_processor *pr, throttling = &pr->throttling; switch (throttling->status_register.space_id) { case ACPI_ADR_SPACE_SYSTEM_IO: + ptc_value = 0; bit_width = throttling->status_register.bit_width; bit_offset = throttling->status_register.bit_offset; acpi_os_read_port((acpi_io_address) throttling->status_register. - address, &ptc_value, + address, (u32 *) &ptc_value, (u32) (bit_width + bit_offset)); ptc_mask = (1 << bit_width) - 1; *value = (u64) ((ptc_value >> bit_offset) & ptc_mask); diff --git a/trunk/drivers/acpi/thermal.c b/trunk/drivers/acpi/thermal.c index 7dbebea1ec31..48fbc647b178 100644 --- a/trunk/drivers/acpi/thermal.c +++ b/trunk/drivers/acpi/thermal.c @@ -941,13 +941,13 @@ static int acpi_thermal_get_info(struct acpi_thermal *tz) if (!tz) return -EINVAL; - /* Get trip points [_CRT, _PSV, etc.] (required) */ - result = acpi_thermal_get_trip_points(tz); + /* Get temperature [_TMP] (required) */ + result = acpi_thermal_get_temperature(tz); if (result) return result; - /* Get temperature [_TMP] (required) */ - result = acpi_thermal_get_temperature(tz); + /* Get trip points [_CRT, _PSV, etc.] (required) */ + result = acpi_thermal_get_trip_points(tz); if (result) return result; diff --git a/trunk/drivers/platform/x86/intel_ips.c b/trunk/drivers/platform/x86/intel_ips.c index f7ba316e0ed6..88a98cff5a44 100644 --- a/trunk/drivers/platform/x86/intel_ips.c +++ b/trunk/drivers/platform/x86/intel_ips.c @@ -609,16 +609,25 @@ static bool mcp_exceeded(struct ips_driver *ips) bool ret = false; u32 temp_limit; u32 avg_power; + const char *msg = "MCP limit exceeded: "; spin_lock_irqsave(&ips->turbo_status_lock, flags); temp_limit = ips->mcp_temp_limit * 100; - if (ips->mcp_avg_temp > temp_limit) + if (ips->mcp_avg_temp > temp_limit) { + dev_info(&ips->dev->dev, + "%sAvg temp %u, limit %u\n", msg, ips->mcp_avg_temp, + temp_limit); ret = true; + } avg_power = ips->cpu_avg_power + ips->mch_avg_power; - if (avg_power > ips->mcp_power_limit) + if (avg_power > ips->mcp_power_limit) { + dev_info(&ips->dev->dev, + "%sAvg power %u, limit %u\n", msg, avg_power, + ips->mcp_power_limit); ret = true; + } spin_unlock_irqrestore(&ips->turbo_status_lock, flags); diff --git a/trunk/drivers/thermal/Kconfig b/trunk/drivers/thermal/Kconfig index 514a691abea0..f7f71b2d3101 100644 --- a/trunk/drivers/thermal/Kconfig +++ b/trunk/drivers/thermal/Kconfig @@ -18,11 +18,3 @@ config THERMAL_HWMON depends on THERMAL depends on HWMON=y || HWMON=THERMAL default y - -config SPEAR_THERMAL - bool "SPEAr thermal sensor driver" - depends on THERMAL - depends on PLAT_SPEAR - help - Enable this to plug the SPEAr thermal sensor driver into the Linux - thermal framework diff --git a/trunk/drivers/thermal/Makefile b/trunk/drivers/thermal/Makefile index a9fff0bf4b14..31108a01c22e 100644 --- a/trunk/drivers/thermal/Makefile +++ b/trunk/drivers/thermal/Makefile @@ -3,4 +3,3 @@ # obj-$(CONFIG_THERMAL) += thermal_sys.o -obj-$(CONFIG_SPEAR_THERMAL) += spear_thermal.o \ No newline at end of file diff --git a/trunk/drivers/thermal/spear_thermal.c b/trunk/drivers/thermal/spear_thermal.c deleted file mode 100644 index c2e32df3b164..000000000000 --- a/trunk/drivers/thermal/spear_thermal.c +++ /dev/null @@ -1,206 +0,0 @@ -/* - * SPEAr thermal driver. - * - * Copyright (C) 2011-2012 ST Microelectronics - * Author: Vincenzo Frascino - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MD_FACTOR 1000 - -/* SPEAr Thermal Sensor Dev Structure */ -struct spear_thermal_dev { - /* pointer to base address of the thermal sensor */ - void __iomem *thermal_base; - /* clk structure */ - struct clk *clk; - /* pointer to thermal flags */ - unsigned int flags; -}; - -static inline int thermal_get_temp(struct thermal_zone_device *thermal, - unsigned long *temp) -{ - struct spear_thermal_dev *stdev = thermal->devdata; - - /* - * Data are ready to be read after 628 usec from POWERDOWN signal - * (PDN) = 1 - */ - *temp = (readl_relaxed(stdev->thermal_base) & 0x7F) * MD_FACTOR; - return 0; -} - -static struct thermal_zone_device_ops ops = { - .get_temp = thermal_get_temp, -}; - -#ifdef CONFIG_PM -static int spear_thermal_suspend(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev); - struct spear_thermal_dev *stdev = spear_thermal->devdata; - unsigned int actual_mask = 0; - - /* Disable SPEAr Thermal Sensor */ - actual_mask = readl_relaxed(stdev->thermal_base); - writel_relaxed(actual_mask & ~stdev->flags, stdev->thermal_base); - - clk_disable(stdev->clk); - dev_info(dev, "Suspended.\n"); - - return 0; -} - -static int spear_thermal_resume(struct device *dev) -{ - struct platform_device *pdev = to_platform_device(dev); - struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev); - struct spear_thermal_dev *stdev = spear_thermal->devdata; - unsigned int actual_mask = 0; - int ret = 0; - - ret = clk_enable(stdev->clk); - if (ret) { - dev_err(&pdev->dev, "Can't enable clock\n"); - return ret; - } - - /* Enable SPEAr Thermal Sensor */ - actual_mask = readl_relaxed(stdev->thermal_base); - writel_relaxed(actual_mask | stdev->flags, stdev->thermal_base); - - dev_info(dev, "Resumed.\n"); - - return 0; -} -#endif - -static SIMPLE_DEV_PM_OPS(spear_thermal_pm_ops, spear_thermal_suspend, - spear_thermal_resume); - -static int spear_thermal_probe(struct platform_device *pdev) -{ - struct thermal_zone_device *spear_thermal = NULL; - struct spear_thermal_dev *stdev; - struct spear_thermal_pdata *pdata; - int ret = 0; - struct resource *stres = platform_get_resource(pdev, IORESOURCE_MEM, 0); - - if (!stres) { - dev_err(&pdev->dev, "memory resource missing\n"); - return -ENODEV; - } - - pdata = dev_get_platdata(&pdev->dev); - if (!pdata) { - dev_err(&pdev->dev, "platform data is NULL\n"); - return -EINVAL; - } - - stdev = devm_kzalloc(&pdev->dev, sizeof(*stdev), GFP_KERNEL); - if (!stdev) { - dev_err(&pdev->dev, "kzalloc fail\n"); - return -ENOMEM; - } - - /* Enable thermal sensor */ - stdev->thermal_base = devm_ioremap(&pdev->dev, stres->start, - resource_size(stres)); - if (!stdev->thermal_base) { - dev_err(&pdev->dev, "ioremap failed\n"); - return -ENOMEM; - } - - stdev->clk = clk_get(&pdev->dev, NULL); - if (IS_ERR(stdev->clk)) { - dev_err(&pdev->dev, "Can't get clock\n"); - return PTR_ERR(stdev->clk); - } - - ret = clk_enable(stdev->clk); - if (ret) { - dev_err(&pdev->dev, "Can't enable clock\n"); - goto put_clk; - } - - stdev->flags = pdata->thermal_flags; - writel_relaxed(stdev->flags, stdev->thermal_base); - - spear_thermal = thermal_zone_device_register("spear_thermal", 0, - stdev, &ops, 0, 0, 0, 0); - if (IS_ERR(spear_thermal)) { - dev_err(&pdev->dev, "thermal zone device is NULL\n"); - ret = PTR_ERR(spear_thermal); - goto disable_clk; - } - - platform_set_drvdata(pdev, spear_thermal); - - dev_info(&spear_thermal->device, "Thermal Sensor Loaded at: 0x%p.\n", - stdev->thermal_base); - - return 0; - -disable_clk: - clk_disable(stdev->clk); -put_clk: - clk_put(stdev->clk); - - return ret; -} - -static int spear_thermal_exit(struct platform_device *pdev) -{ - unsigned int actual_mask = 0; - struct thermal_zone_device *spear_thermal = platform_get_drvdata(pdev); - struct spear_thermal_dev *stdev = spear_thermal->devdata; - - thermal_zone_device_unregister(spear_thermal); - platform_set_drvdata(pdev, NULL); - - /* Disable SPEAr Thermal Sensor */ - actual_mask = readl_relaxed(stdev->thermal_base); - writel_relaxed(actual_mask & ~stdev->flags, stdev->thermal_base); - - clk_disable(stdev->clk); - clk_put(stdev->clk); - - return 0; -} - -static struct platform_driver spear_thermal_driver = { - .probe = spear_thermal_probe, - .remove = spear_thermal_exit, - .driver = { - .name = "spear_thermal", - .owner = THIS_MODULE, - .pm = &spear_thermal_pm_ops, - }, -}; - -module_platform_driver(spear_thermal_driver); - -MODULE_AUTHOR("Vincenzo Frascino "); -MODULE_DESCRIPTION("SPEAr thermal driver"); -MODULE_LICENSE("GPL"); diff --git a/trunk/drivers/thermal/thermal_sys.c b/trunk/drivers/thermal/thermal_sys.c index 022bacb71a7e..220ce7e31cf5 100644 --- a/trunk/drivers/thermal/thermal_sys.c +++ b/trunk/drivers/thermal/thermal_sys.c @@ -23,8 +23,6 @@ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - #include #include #include @@ -41,6 +39,8 @@ MODULE_AUTHOR("Zhang Rui"); MODULE_DESCRIPTION("Generic thermal management sysfs support"); MODULE_LICENSE("GPL"); +#define PREFIX "Thermal: " + struct thermal_cooling_device_instance { int id; char name[THERMAL_NAME_LENGTH]; @@ -60,11 +60,13 @@ static LIST_HEAD(thermal_tz_list); static LIST_HEAD(thermal_cdev_list); static DEFINE_MUTEX(thermal_list_lock); +static unsigned int thermal_event_seqnum; + static int get_idr(struct idr *idr, struct mutex *lock, int *id) { int err; -again: + again: if (unlikely(idr_pre_get(idr, GFP_KERNEL) == 0)) return -ENOMEM; @@ -150,9 +152,9 @@ mode_store(struct device *dev, struct device_attribute *attr, if (!tz->ops->set_mode) return -EPERM; - if (!strncmp(buf, "enabled", sizeof("enabled") - 1)) + if (!strncmp(buf, "enabled", sizeof("enabled"))) result = tz->ops->set_mode(tz, THERMAL_DEVICE_ENABLED); - else if (!strncmp(buf, "disabled", sizeof("disabled") - 1)) + else if (!strncmp(buf, "disabled", sizeof("disabled"))) result = tz->ops->set_mode(tz, THERMAL_DEVICE_DISABLED); else result = -EINVAL; @@ -281,7 +283,8 @@ passive_show(struct device *dev, struct device_attribute *attr, static DEVICE_ATTR(type, 0444, type_show, NULL); static DEVICE_ATTR(temp, 0444, temp_show, NULL); static DEVICE_ATTR(mode, 0644, mode_show, mode_store); -static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store); +static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, \ + passive_store); static struct device_attribute trip_point_attrs[] = { __ATTR(trip_point_0_type, 0444, trip_point_type_show, NULL), @@ -310,6 +313,22 @@ static struct device_attribute trip_point_attrs[] = { __ATTR(trip_point_11_temp, 0444, trip_point_temp_show, NULL), }; +#define TRIP_POINT_ATTR_ADD(_dev, _index, result) \ +do { \ + result = device_create_file(_dev, \ + &trip_point_attrs[_index * 2]); \ + if (result) \ + break; \ + result = device_create_file(_dev, \ + &trip_point_attrs[_index * 2 + 1]); \ +} while (0) + +#define TRIP_POINT_ATTR_REMOVE(_dev, _index) \ +do { \ + device_remove_file(_dev, &trip_point_attrs[_index * 2]); \ + device_remove_file(_dev, &trip_point_attrs[_index * 2 + 1]); \ +} while (0) + /* sys I/F for cooling device */ #define to_cooling_device(_dev) \ container_of(_dev, struct thermal_cooling_device, device) @@ -816,14 +835,15 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz, return 0; device_remove_file(&tz->device, &dev->attr); -remove_symbol_link: + remove_symbol_link: sysfs_remove_link(&tz->device.kobj, dev->name); -release_idr: + release_idr: release_idr(&tz->idr, &tz->lock, dev->id); -free_mem: + free_mem: kfree(dev); return result; } + EXPORT_SYMBOL(thermal_zone_bind_cooling_device); /** @@ -853,13 +873,14 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, return -ENODEV; -unbind: + unbind: device_remove_file(&tz->device, &pos->attr); sysfs_remove_link(&tz->device.kobj, pos->name); release_idr(&tz->idr, &tz->lock, pos->id); kfree(pos); return 0; } + EXPORT_SYMBOL(thermal_zone_unbind_cooling_device); static void thermal_release(struct device *dev) @@ -867,8 +888,7 @@ static void thermal_release(struct device *dev) struct thermal_zone_device *tz; struct thermal_cooling_device *cdev; - if (!strncmp(dev_name(dev), "thermal_zone", - sizeof("thermal_zone") - 1)) { + if (!strncmp(dev_name(dev), "thermal_zone", sizeof "thermal_zone" - 1)) { tz = to_thermal_zone(dev); kfree(tz); } else { @@ -888,9 +908,8 @@ static struct class thermal_class = { * @devdata: device private data. * @ops: standard thermal cooling devices callbacks. */ -struct thermal_cooling_device * -thermal_cooling_device_register(char *type, void *devdata, - const struct thermal_cooling_device_ops *ops) +struct thermal_cooling_device *thermal_cooling_device_register( + char *type, void *devdata, const struct thermal_cooling_device_ops *ops) { struct thermal_cooling_device *cdev; struct thermal_zone_device *pos; @@ -955,11 +974,12 @@ thermal_cooling_device_register(char *type, void *devdata, if (!result) return cdev; -unregister: + unregister: release_idr(&thermal_cdev_idr, &thermal_idr_lock, cdev->id); device_unregister(&cdev->device); return ERR_PTR(result); } + EXPORT_SYMBOL(thermal_cooling_device_register); /** @@ -1004,6 +1024,7 @@ void thermal_cooling_device_unregister(struct device_unregister(&cdev->device); return; } + EXPORT_SYMBOL(thermal_cooling_device_unregister); /** @@ -1023,7 +1044,8 @@ void thermal_zone_device_update(struct thermal_zone_device *tz) if (tz->ops->get_temp(tz, &temp)) { /* get_temp failed - retry it later */ - pr_warn("failed to read out thermal zone %d\n", tz->id); + printk(KERN_WARNING PREFIX "failed to read out thermal zone " + "%d\n", tz->id); goto leave; } @@ -1038,8 +1060,9 @@ void thermal_zone_device_update(struct thermal_zone_device *tz) ret = tz->ops->notify(tz, count, trip_type); if (!ret) { - pr_emerg("Critical temperature reached (%ld C), shutting down\n", - temp/1000); + printk(KERN_EMERG + "Critical temperature reached (%ld C), shutting down.\n", + temp/1000); orderly_poweroff(true); } } @@ -1077,7 +1100,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz) tz->last_temperature = temp; -leave: + leave: if (tz->passive) thermal_zone_device_set_polling(tz, tz->passive_delay); else if (tz->polling_delay) @@ -1176,12 +1199,7 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, } for (count = 0; count < trips; count++) { - result = device_create_file(&tz->device, - &trip_point_attrs[count * 2]); - if (result) - break; - result = device_create_file(&tz->device, - &trip_point_attrs[count * 2 + 1]); + TRIP_POINT_ATTR_ADD(&tz->device, count, result); if (result) goto unregister; tz->ops->get_trip_type(tz, count, &trip_type); @@ -1217,11 +1235,12 @@ struct thermal_zone_device *thermal_zone_device_register(char *type, if (!result) return tz; -unregister: + unregister: release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); device_unregister(&tz->device); return ERR_PTR(result); } + EXPORT_SYMBOL(thermal_zone_device_register); /** @@ -1260,12 +1279,9 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) if (tz->ops->get_mode) device_remove_file(&tz->device, &dev_attr_mode); - for (count = 0; count < tz->trips; count++) { - device_remove_file(&tz->device, - &trip_point_attrs[count * 2]); - device_remove_file(&tz->device, - &trip_point_attrs[count * 2 + 1]); - } + for (count = 0; count < tz->trips; count++) + TRIP_POINT_ATTR_REMOVE(&tz->device, count); + thermal_remove_hwmon_sysfs(tz); release_idr(&thermal_tz_idr, &thermal_idr_lock, tz->id); idr_destroy(&tz->idr); @@ -1273,6 +1289,7 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) device_unregister(&tz->device); return; } + EXPORT_SYMBOL(thermal_zone_device_unregister); #ifdef CONFIG_NET @@ -1295,11 +1312,10 @@ int thermal_generate_netlink_event(u32 orig, enum events event) void *msg_header; int size; int result; - static unsigned int thermal_event_seqnum; /* allocate memory */ - size = nla_total_size(sizeof(struct thermal_genl_event)) + - nla_total_size(0); + size = nla_total_size(sizeof(struct thermal_genl_event)) + \ + nla_total_size(0); skb = genlmsg_new(size, GFP_ATOMIC); if (!skb) @@ -1315,8 +1331,8 @@ int thermal_generate_netlink_event(u32 orig, enum events event) } /* fill the data */ - attr = nla_reserve(skb, THERMAL_GENL_ATTR_EVENT, - sizeof(struct thermal_genl_event)); + attr = nla_reserve(skb, THERMAL_GENL_ATTR_EVENT, \ + sizeof(struct thermal_genl_event)); if (!attr) { nlmsg_free(skb); @@ -1343,7 +1359,7 @@ int thermal_generate_netlink_event(u32 orig, enum events event) result = genlmsg_multicast(skb, 0, thermal_event_mcgrp.id, GFP_ATOMIC); if (result) - pr_info("failed to send netlink event:%d\n", result); + printk(KERN_INFO "failed to send netlink event:%d", result); return result; } diff --git a/trunk/include/linux/platform_data/spear_thermal.h b/trunk/include/linux/platform_data/spear_thermal.h deleted file mode 100644 index 724f2e1cbbcb..000000000000 --- a/trunk/include/linux/platform_data/spear_thermal.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * SPEAr thermal driver platform data. - * - * Copyright (C) 2011-2012 ST Microelectronics - * Author: Vincenzo Frascino - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ -#ifndef SPEAR_THERMAL_H -#define SPEAR_THERMAL_H - -/* SPEAr Thermal Sensor Platform Data */ -struct spear_thermal_pdata { - /* flags used to enable thermal sensor */ - unsigned int thermal_flags; -}; - -#endif /* SPEAR_THERMAL_H */