Skip to content

Commit

Permalink
thermal/core: Move thermal_set_delay_jiffies to static
Browse files Browse the repository at this point in the history
The function 'thermal_set_delay_jiffies' is only used in
thermal_core.c but it is defined and implemented in a separate
file. Move the function to thermal_core.c and make it static.

Cc: Alexandre Bailon <abailon@baylibre.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linexp.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Link: https://lore.kernel.org/r/20220722200007.1839356-7-daniel.lezcano@linexp.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
  • Loading branch information
Daniel Lezcano authored and Daniel Lezcano committed Jul 28, 2022
1 parent 6390383 commit e5f2cda
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 7 additions & 0 deletions drivers/thermal/thermal_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,13 @@ static void bind_tz(struct thermal_zone_device *tz)
mutex_unlock(&thermal_list_lock);
}

static void thermal_set_delay_jiffies(unsigned long *delay_jiffies, int delay_ms)
{
*delay_jiffies = msecs_to_jiffies(delay_ms);
if (delay_ms > 1000)
*delay_jiffies = round_jiffies(*delay_jiffies);
}

/**
* thermal_zone_device_register() - register a new thermal zone device
* @type: the thermal zone device type
Expand Down
1 change: 0 additions & 1 deletion drivers/thermal/thermal_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ int thermal_build_list_of_policies(char *buf);

/* Helpers */
void thermal_zone_set_trips(struct thermal_zone_device *tz);
void thermal_set_delay_jiffies(unsigned long *delay_jiffies, int delay_ms);

/* sysfs I/F */
int thermal_zone_create_device_groups(struct thermal_zone_device *, int);
Expand Down
7 changes: 0 additions & 7 deletions drivers/thermal/thermal_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,6 @@ void thermal_zone_set_trips(struct thermal_zone_device *tz)
mutex_unlock(&tz->lock);
}

void thermal_set_delay_jiffies(unsigned long *delay_jiffies, int delay_ms)
{
*delay_jiffies = msecs_to_jiffies(delay_ms);
if (delay_ms > 1000)
*delay_jiffies = round_jiffies(*delay_jiffies);
}

static void thermal_cdev_set_cur_state(struct thermal_cooling_device *cdev,
int target)
{
Expand Down

0 comments on commit e5f2cda

Please sign in to comment.