Skip to content

Commit

Permalink
ACPI: gracefully print null trip-point device
Browse files Browse the repository at this point in the history
if acpi_bus_get_device() returns NULL, print nothing
instead of "<NUL" in /proc/acpi/thermal_zone/*/trip_points

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Thomas Renninger authored and Len Brown committed Jun 18, 2007
1 parent 188e1f8 commit e7c746e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,8 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_thermal *tz = seq->private;
struct acpi_device *device;
acpi_status status;

int i = 0;
int j = 0;

Expand All @@ -850,8 +852,10 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
tz->trips.passive.tc1, tz->trips.passive.tc2,
tz->trips.passive.tsp);
for (j = 0; j < tz->trips.passive.devices.count; j++) {
acpi_bus_get_device(tz->trips.passive.devices.handles[j], &device);
seq_printf(seq, "%4.4s ", acpi_device_bid(device));
status = acpi_bus_get_device(tz->trips.passive.devices.
handles[j], &device);
seq_printf(seq, "%4.4s ", status ? "" :
acpi_device_bid(device));
}
seq_puts(seq, "\n");
}
Expand All @@ -863,8 +867,11 @@ static int acpi_thermal_trip_seq_show(struct seq_file *seq, void *offset)
i,
KELVIN_TO_CELSIUS(tz->trips.active[i].temperature));
for (j = 0; j < tz->trips.active[i].devices.count; j++){
acpi_bus_get_device(tz->trips.active[i].devices.handles[j], &device);
seq_printf(seq, "%4.4s ", acpi_device_bid(device));
status = acpi_bus_get_device(tz->trips.active[i].
devices.handles[j],
&device);
seq_printf(seq, "%4.4s ", status ? "" :
acpi_device_bid(device));
}
seq_puts(seq, "\n");
}
Expand Down

0 comments on commit e7c746e

Please sign in to comment.