Skip to content

Commit

Permalink
thermal: fix intel PCH thermal driver mismerge
Browse files Browse the repository at this point in the history
I didn't notice this when merging the thermal code from Zhang, but his
merge (commit 5a924a0: "Merge branches 'thermal-core' and
'thermal-intel' of .git into next") of the thermal-core and
thermal-intel branches was wrong.

In thermal-core, commit 17e8351 ("thermal: consistently use int for
temperatures") converted the thermal layer to use "int" for
temperatures.

But in parallel, in the thermal-intel branch commit d0a1262
("thermal: Add Intel PCH thermal driver") added support for the intel
PCH thermal sensor using the old interfaces that used "unsigned long"
pointers.

This resulted in warnings like this:

  drivers/thermal/intel_pch_thermal.c:184:14: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
    .get_temp = pch_thermal_get_temp,
                ^
  drivers/thermal/intel_pch_thermal.c:184:14: note: (near initialization for ‘tzd_ops.get_temp’)
  drivers/thermal/intel_pch_thermal.c:186:19: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
    .get_trip_temp = pch_get_trip_temp,
                     ^
  drivers/thermal/intel_pch_thermal.c:186:19: note: (near initialization for ‘tzd_ops.get_trip_temp’)

This fixes it.

Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Sep 12, 2015
1 parent 01b0c01 commit dfb22fc
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/thermal/intel_pch_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ static int pch_wpt_init(struct pch_thermal_device *ptd, int *nr_trips)
return 0;
}

static int pch_wpt_get_temp(struct pch_thermal_device *ptd,
unsigned long *temp)
static int pch_wpt_get_temp(struct pch_thermal_device *ptd, int *temp)
{
u8 wpt_temp;

Expand All @@ -132,7 +131,7 @@ static int pch_wpt_get_temp(struct pch_thermal_device *ptd,

struct pch_dev_ops {
int (*hw_init)(struct pch_thermal_device *ptd, int *nr_trips);
int (*get_temp)(struct pch_thermal_device *ptd, unsigned long *temp);
int (*get_temp)(struct pch_thermal_device *ptd, int *temp);
};


Expand All @@ -142,8 +141,7 @@ static struct pch_dev_ops pch_dev_ops_wpt = {
.get_temp = pch_wpt_get_temp,
};

static int pch_thermal_get_temp(struct thermal_zone_device *tzd,
unsigned long *temp)
static int pch_thermal_get_temp(struct thermal_zone_device *tzd, int *temp)
{
struct pch_thermal_device *ptd = tzd->devdata;

Expand All @@ -165,8 +163,7 @@ static int pch_get_trip_type(struct thermal_zone_device *tzd, int trip,
return 0;
}

static int pch_get_trip_temp(struct thermal_zone_device *tzd, int trip,
unsigned long *temp)
static int pch_get_trip_temp(struct thermal_zone_device *tzd, int trip, int *temp)
{
struct pch_thermal_device *ptd = tzd->devdata;

Expand Down

0 comments on commit dfb22fc

Please sign in to comment.