Skip to content

Commit

Permalink
PM / devfreq: Move private devfreq_update_stats() into devfreq
Browse files Browse the repository at this point in the history
THe devfreq_update_stats() updates the 'struct devfreq_dev_status'
in order to get current status of devfreq device. It is only used
for the governors.

This patch moves the devfreq_update_stats() into devfreq directory.

Signed-off-by: Chanwoo Choi <cwchoi00@gmail.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
  • Loading branch information
chanwoochoi authored and myungjoo committed Aug 28, 2017
1 parent e8305d4 commit f75b0af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
4 changes: 4 additions & 0 deletions drivers/devfreq/governor.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@ extern int devfreq_remove_governor(struct devfreq_governor *governor);

extern int devfreq_update_status(struct devfreq *devfreq, unsigned long freq);

static inline int devfreq_update_stats(struct devfreq *df)
{
return df->profile->get_dev_status(df->dev.parent, &df->last_status);
}
#endif /* _GOVERNOR_H */
13 changes: 0 additions & 13 deletions include/linux/devfreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,6 @@ extern void devm_devfreq_unregister_notifier(struct device *dev,
extern struct devfreq *devfreq_get_devfreq_by_phandle(struct device *dev,
int index);

/**
* devfreq_update_stats() - update the last_status pointer in struct devfreq
* @df: the devfreq instance whose status needs updating
*
* Governors are recommended to use this function along with last_status,
* which allows other entities to reuse the last_status without affecting
* the values fetched later by governors.
*/
static inline int devfreq_update_stats(struct devfreq *df)
{
return df->profile->get_dev_status(df->dev.parent, &df->last_status);
}

#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
/**
* struct devfreq_simple_ondemand_data - void *data fed to struct devfreq
Expand Down

0 comments on commit f75b0af

Please sign in to comment.