Skip to content

Commit

Permalink
platform/x86: asus-wmi: switch to use <linux/units.h> helpers
Browse files Browse the repository at this point in the history
The asus-wmi driver doesn't implement the thermal device functionality
directly, so including <linux/thermal.h> just for
DECI_KELVIN_TO_CELSIUS() is a bit odd.

This switches the asus-wmi driver to use deci_kelvin_to_millicelsius()
in <linux/units.h>.

The format string is changed from %d to %ld due to function returned
type.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Akinobu Mita <[email protected]>
Acked-by: Andy Shevchenko <[email protected]>
Cc: Sujith Thomas <[email protected]>
Cc: Darren Hart <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: Zhang Rui <[email protected]>
Cc: Daniel Lezcano <[email protected]>
Cc: Amit Kucheria <[email protected]>
Cc: Jean Delvare <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: Keith Busch <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Sagi Grimberg <[email protected]>
Cc: Emmanuel Grumbach <[email protected]>
Cc: Hartmut Knaack <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Jonathan Cameron <[email protected]>
Cc: Kalle Valo <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Luca Coelho <[email protected]>
Cc: Peter Meerwald-Stadler <[email protected]>
Cc: Stanislaw Gruszka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
mita authored and torvalds committed Jan 31, 2020
1 parent 7f49a5c commit f07b9fd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
#include <linux/seq_file.h>
#include <linux/platform_data/x86/asus-wmi.h>
#include <linux/platform_device.h>
#include <linux/thermal.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/units.h>

#include <acpi/battery.h>
#include <acpi/video.h>
Expand Down Expand Up @@ -1514,9 +1514,8 @@ static ssize_t asus_hwmon_temp1(struct device *dev,
if (err < 0)
return err;

value = DECI_KELVIN_TO_CELSIUS((value & 0xFFFF)) * 1000;

return sprintf(buf, "%d\n", value);
return sprintf(buf, "%ld\n",
deci_kelvin_to_millicelsius(value & 0xFFFF));
}

/* Fan1 */
Expand Down

0 comments on commit f07b9fd

Please sign in to comment.