projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hwmon: (adt7470) Support per-sensor alarm files
[powerpc.git]
/
drivers
/
hwmon
/
coretemp.c
diff --git
a/drivers/hwmon/coretemp.c
b/drivers/hwmon/coretemp.c
index
7c17952
..
3ee60d2
100644
(file)
--- a/
drivers/hwmon/coretemp.c
+++ b/
drivers/hwmon/coretemp.c
@@
-47,7
+47,7
@@
typedef enum { SHOW_TEMP, SHOW_TJMAX, SHOW_LABEL, SHOW_NAME } SHOW;
static struct coretemp_data *coretemp_update_device(struct device *dev);
struct coretemp_data {
static struct coretemp_data *coretemp_update_device(struct device *dev);
struct coretemp_data {
- struct
class_device *class
_dev;
+ struct
device *hwmon
_dev;
struct mutex update_lock;
const char *name;
u32 id;
struct mutex update_lock;
const char *name;
u32 id;
@@
-58,8
+58,6
@@
struct coretemp_data {
u8 alarm;
};
u8 alarm;
};
-static struct coretemp_data *coretemp_update_device(struct device *dev);
-
/*
* Sysfs stuff
*/
/*
* Sysfs stuff
*/
@@
-152,7
+150,7
@@
static struct coretemp_data *coretemp_update_device(struct device *dev)
static int __devinit coretemp_probe(struct platform_device *pdev)
{
struct coretemp_data *data;
static int __devinit coretemp_probe(struct platform_device *pdev)
{
struct coretemp_data *data;
- struct cpuinfo_x86 *c = &
(cpu_data)[pdev->id]
;
+ struct cpuinfo_x86 *c = &
cpu_data(pdev->id)
;
int err;
u32 eax, edx;
int err;
u32 eax, edx;
@@
-228,9
+226,9
@@
static int __devinit coretemp_probe(struct platform_device *pdev)
if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group)))
goto exit_free;
if ((err = sysfs_create_group(&pdev->dev.kobj, &coretemp_group)))
goto exit_free;
- data->
class
_dev = hwmon_device_register(&pdev->dev);
- if (IS_ERR(data->
class
_dev)) {
- err = PTR_ERR(data->
class
_dev);
+ data->
hwmon
_dev = hwmon_device_register(&pdev->dev);
+ if (IS_ERR(data->
hwmon
_dev)) {
+ err = PTR_ERR(data->
hwmon
_dev);
dev_err(&pdev->dev, "Class registration failed (%d)\n",
err);
goto exit_class;
dev_err(&pdev->dev, "Class registration failed (%d)\n",
err);
goto exit_class;
@@
-250,7
+248,7
@@
static int __devexit coretemp_remove(struct platform_device *pdev)
{
struct coretemp_data *data = platform_get_drvdata(pdev);
{
struct coretemp_data *data = platform_get_drvdata(pdev);
- hwmon_device_unregister(data->
class
_dev);
+ hwmon_device_unregister(data->
hwmon
_dev);
sysfs_remove_group(&pdev->dev.kobj, &coretemp_group);
platform_set_drvdata(pdev, NULL);
kfree(data);
sysfs_remove_group(&pdev->dev.kobj, &coretemp_group);
platform_set_drvdata(pdev, NULL);
kfree(data);
@@
-339,18
+337,17
@@
static int coretemp_cpu_callback(struct notifier_block *nfb,
switch (action) {
case CPU_ONLINE:
switch (action) {
case CPU_ONLINE:
- case CPU_
ONLINE_FROZEN
:
+ case CPU_
DOWN_FAILED
:
coretemp_device_add(cpu);
break;
coretemp_device_add(cpu);
break;
- case CPU_DEAD:
- case CPU_DEAD_FROZEN:
+ case CPU_DOWN_PREPARE:
coretemp_device_remove(cpu);
break;
}
return NOTIFY_OK;
}
coretemp_device_remove(cpu);
break;
}
return NOTIFY_OK;
}
-static struct notifier_block
__cpuinitdata
coretemp_cpu_notifier = {
+static struct notifier_block coretemp_cpu_notifier = {
.notifier_call = coretemp_cpu_callback,
};
#endif /* !CONFIG_HOTPLUG_CPU */
.notifier_call = coretemp_cpu_callback,
};
#endif /* !CONFIG_HOTPLUG_CPU */
@@
-361,7
+358,7
@@
static int __init coretemp_init(void)
struct pdev_entry *p, *n;
/* quick check if we run Intel */
struct pdev_entry *p, *n;
/* quick check if we run Intel */
- if (cpu_data
[0]
.x86_vendor != X86_VENDOR_INTEL)
+ if (cpu_data
(0)
.x86_vendor != X86_VENDOR_INTEL)
goto exit;
err = platform_driver_register(&coretemp_driver);
goto exit;
err = platform_driver_register(&coretemp_driver);
@@
-369,11
+366,12
@@
static int __init coretemp_init(void)
goto exit;
for_each_online_cpu(i) {
goto exit;
for_each_online_cpu(i) {
- struct cpuinfo_x86 *c = &
(cpu_data)[i]
;
+ struct cpuinfo_x86 *c = &
cpu_data(i)
;
- /* check if family 6, models e, f */
+ /* check if family 6, models e, f
, 16
*/
if ((c->cpuid_level < 0) || (c->x86 != 0x6) ||
if ((c->cpuid_level < 0) || (c->x86 != 0x6) ||
- !((c->x86_model == 0xe) || (c->x86_model == 0xf))) {
+ !((c->x86_model == 0xe) || (c->x86_model == 0xf) ||
+ (c->x86_model == 0x16))) {
/* supported CPU not found, but report the unknown
family 6 CPU */
/* supported CPU not found, but report the unknown
family 6 CPU */