Re: [PATCH 3/3] hwmon: (coretemp) Convert to use devm_hwmon_device_register_with_groups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/23/2014 07:59 AM, Jean Delvare wrote:
Hi Guenter,

On Sun, 16 Feb 2014 15:59:35 -0800, Guenter Roeck wrote:
Simplify code, reduce code size, and attach sysfs attributes to hwmon device.

For this driver, the only attribute created is the name attribute.
Other attributes are still created and removed dynamically as cores
are added or removed.

Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
---
  drivers/hwmon/coretemp.c |   49 +++++++++-------------------------------------
  1 file changed, 9 insertions(+), 40 deletions(-)

diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 944f850..87e0fa9 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
(...)
@@ -524,7 +508,7 @@ static int create_core_data(struct platform_device *pdev, unsigned int cpu,
  		goto exit_free;

  	/* We can access status register. Get Critical Temperature */
-	tdata->tjmax = get_tjmax(c, cpu, &pdev->dev);
+	tdata->tjmax = get_tjmax(c, cpu, pdata->hwmon_dev);

I disagree with this change. This will cause log messages to look like
that:

hwmon hwmon1: TjMax is 97 degrees C

Instead of the previous:

coretemp coretemp.0: TjMax is 97 degrees C

I thought we agreed that probe-time messages should be attached to the
physical device?


You are right, that doesn't make much sense. I'll change it back
to the platform device.


  	/*
  	 * Read the still undocumented bits 8:15 of IA32_TEMPERATURE_TARGET.
(...)

Everything else looks OK.

Reviewed-by: Jean Delvare <jdelvare@xxxxxxx>
Tested-by: Jean Delvare <jdelvare@xxxxxxx>

Thanks a lot for the review and test!

Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux