diff options
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/therm_pm72.c | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index 6fadc9ac66b0..1e0a69a5e815 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c | |||
@@ -1157,6 +1157,8 @@ static void do_monitor_cpu_rack(struct cpu_pid_state *state) | |||
1157 | */ | 1157 | */ |
1158 | static int init_cpu_state(struct cpu_pid_state *state, int index) | 1158 | static int init_cpu_state(struct cpu_pid_state *state, int index) |
1159 | { | 1159 | { |
1160 | int err; | ||
1161 | |||
1160 | state->index = index; | 1162 | state->index = index; |
1161 | state->first = 1; | 1163 | state->first = 1; |
1162 | state->rpm = (cpu_pid_type == CPU_PID_TYPE_RACKMAC) ? 4000 : 1000; | 1164 | state->rpm = (cpu_pid_type == CPU_PID_TYPE_RACKMAC) ? 4000 : 1000; |
@@ -1182,18 +1184,21 @@ static int init_cpu_state(struct cpu_pid_state *state, int index) | |||
1182 | DBG("CPU %d Using %d power history entries\n", index, state->count_power); | 1184 | DBG("CPU %d Using %d power history entries\n", index, state->count_power); |
1183 | 1185 | ||
1184 | if (index == 0) { | 1186 | if (index == 0) { |
1185 | device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature); | 1187 | err = device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature); |
1186 | device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage); | 1188 | err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage); |
1187 | device_create_file(&of_dev->dev, &dev_attr_cpu0_current); | 1189 | err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_current); |
1188 | device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm); | 1190 | err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm); |
1189 | device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm); | 1191 | err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm); |
1190 | } else { | 1192 | } else { |
1191 | device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature); | 1193 | err = device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature); |
1192 | device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage); | 1194 | err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage); |
1193 | device_create_file(&of_dev->dev, &dev_attr_cpu1_current); | 1195 | err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_current); |
1194 | device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm); | 1196 | err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm); |
1195 | device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm); | 1197 | err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm); |
1196 | } | 1198 | } |
1199 | if (err) | ||
1200 | printk(KERN_WARNING "Failed to create some of the atribute" | ||
1201 | "files for CPU %d\n", index); | ||
1197 | 1202 | ||
1198 | return 0; | 1203 | return 0; |
1199 | fail: | 1204 | fail: |
@@ -1329,6 +1334,7 @@ static int init_backside_state(struct backside_pid_state *state) | |||
1329 | { | 1334 | { |
1330 | struct device_node *u3; | 1335 | struct device_node *u3; |
1331 | int u3h = 1; /* conservative by default */ | 1336 | int u3h = 1; /* conservative by default */ |
1337 | int err; | ||
1332 | 1338 | ||
1333 | /* | 1339 | /* |
1334 | * There are different PID params for machines with U3 and machines | 1340 | * There are different PID params for machines with U3 and machines |
@@ -1380,8 +1386,11 @@ static int init_backside_state(struct backside_pid_state *state) | |||
1380 | if (state->monitor == NULL) | 1386 | if (state->monitor == NULL) |
1381 | return -ENODEV; | 1387 | return -ENODEV; |
1382 | 1388 | ||
1383 | device_create_file(&of_dev->dev, &dev_attr_backside_temperature); | 1389 | err = device_create_file(&of_dev->dev, &dev_attr_backside_temperature); |
1384 | device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm); | 1390 | err |= device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm); |
1391 | if (err) | ||
1392 | printk(KERN_WARNING "Failed to create attribute file(s)" | ||
1393 | " for backside fan\n"); | ||
1385 | 1394 | ||
1386 | return 0; | 1395 | return 0; |
1387 | } | 1396 | } |
@@ -1492,6 +1501,8 @@ static void do_monitor_drives(struct drives_pid_state *state) | |||
1492 | */ | 1501 | */ |
1493 | static int init_drives_state(struct drives_pid_state *state) | 1502 | static int init_drives_state(struct drives_pid_state *state) |
1494 | { | 1503 | { |
1504 | int err; | ||
1505 | |||
1495 | state->ticks = 1; | 1506 | state->ticks = 1; |
1496 | state->first = 1; | 1507 | state->first = 1; |
1497 | state->rpm = 1000; | 1508 | state->rpm = 1000; |
@@ -1500,8 +1511,11 @@ static int init_drives_state(struct drives_pid_state *state) | |||
1500 | if (state->monitor == NULL) | 1511 | if (state->monitor == NULL) |
1501 | return -ENODEV; | 1512 | return -ENODEV; |
1502 | 1513 | ||
1503 | device_create_file(&of_dev->dev, &dev_attr_drives_temperature); | 1514 | err = device_create_file(&of_dev->dev, &dev_attr_drives_temperature); |
1504 | device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm); | 1515 | err |= device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm); |
1516 | if (err) | ||
1517 | printk(KERN_WARNING "Failed to create attribute file(s)" | ||
1518 | " for drives bay fan\n"); | ||
1505 | 1519 | ||
1506 | return 0; | 1520 | return 0; |
1507 | } | 1521 | } |
@@ -1622,7 +1636,9 @@ static int init_dimms_state(struct dimm_pid_state *state) | |||
1622 | if (state->monitor == NULL) | 1636 | if (state->monitor == NULL) |
1623 | return -ENODEV; | 1637 | return -ENODEV; |
1624 | 1638 | ||
1625 | device_create_file(&of_dev->dev, &dev_attr_dimms_temperature); | 1639 | if (device_create_file(&of_dev->dev, &dev_attr_dimms_temperature)) |
1640 | printk(KERN_WARNING "Failed to create attribute file" | ||
1641 | " for DIMM temperature\n"); | ||
1626 | 1642 | ||
1627 | return 0; | 1643 | return 0; |
1628 | } | 1644 | } |
@@ -1732,6 +1748,8 @@ static void do_monitor_slots(struct slots_pid_state *state) | |||
1732 | */ | 1748 | */ |
1733 | static int init_slots_state(struct slots_pid_state *state) | 1749 | static int init_slots_state(struct slots_pid_state *state) |
1734 | { | 1750 | { |
1751 | int err; | ||
1752 | |||
1735 | state->ticks = 1; | 1753 | state->ticks = 1; |
1736 | state->first = 1; | 1754 | state->first = 1; |
1737 | state->pwm = 50; | 1755 | state->pwm = 50; |
@@ -1740,8 +1758,11 @@ static int init_slots_state(struct slots_pid_state *state) | |||
1740 | if (state->monitor == NULL) | 1758 | if (state->monitor == NULL) |
1741 | return -ENODEV; | 1759 | return -ENODEV; |
1742 | 1760 | ||
1743 | device_create_file(&of_dev->dev, &dev_attr_slots_temperature); | 1761 | err = device_create_file(&of_dev->dev, &dev_attr_slots_temperature); |
1744 | device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm); | 1762 | err |= device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm); |
1763 | if (err) | ||
1764 | printk(KERN_WARNING "Failed to create attribute file(s)" | ||
1765 | " for slots bay fan\n"); | ||
1745 | 1766 | ||
1746 | return 0; | 1767 | return 0; |
1747 | } | 1768 | } |