Re: [PATCH] thermal: Add support for thermal sensor present onSPEAr13xx machines

From: Andrew Morton
Date: Fri Feb 24 2012 - 15:02:52 EST


On Fri, 24 Feb 2012 12:57:38 +0530
Viresh Kumar <viresh.kumar@xxxxxx> wrote:

> From: Vincenzo Frascino <vincenzo.frascino@xxxxxx>
>
> ST's SPEAr13xx machines are based on CortexA9 ARM processors. These
> machines contain a thermal sensor for junction temperature monitoring.
>
> This patch adds support for this thermal sensor in existing thermal
> framework.
>
> --- a/drivers/thermal/Kconfig
> +++ b/drivers/thermal/Kconfig
> @@ -18,3 +18,10 @@ config THERMAL_HWMON
> depends on THERMAL
> depends on HWMON=y || HWMON=THERMAL
> default y
> +
> +config SPEAR_THERMAL
> + bool "SPEAr thermal sensor driver"
> + depends on THERMAL
> + help
> + Enable this to plug the SPEAr thermal sensor driver into the Linux
> + thermal framework

The driver can be compiled for all architectures which support
CONFIG_THERMAL. This includes x86_64. Was that intended?

I don't think it's necessarily a bad thing: it gives the driver a lot
more compilation coverage and exposes bugs such as

drivers/thermal/spear_thermal.c: In function 'spear_thermal_probe':
drivers/thermal/spear_thermal.c:159: warning: cast from pointer to integer of different size

--- a/drivers/thermal/spear_thermal.c~thermal-add-support-for-thermal-sensor-present-on-spear13xx-machines-fix
+++ a/drivers/thermal/spear_thermal.c
@@ -156,8 +156,8 @@ static int spear_thermal_probe(struct pl

platform_set_drvdata(pdev, spear_thermal);

- dev_info(&spear_thermal->device, "Thermal Sensor Loaded at: 0x%x.\n",
- (unsigned int)stdev->thermal_base);
+ dev_info(&spear_thermal->device, "Thermal Sensor Loaded at: 0x%p.\n",
+ stdev->thermal_base);

return 0;


but I do wonder if this was intentional.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/