summaryrefslogtreecommitdiff
path: root/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
diff options
context:
space:
mode:
authorWu Xiaotian <[email protected]>2019-05-22 10:20:51 +0800
committerraveit65 <[email protected]>2019-05-27 17:21:31 +0200
commitadf5920f13380611d5e5b5cb712e5b2e6b1eed9c (patch)
tree38ef09c9903c69efdb24bd3b3313a564abbd0852 /cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
parent6fbca0cb8cfe6bedc6728a5e24384ffcbd769b9b (diff)
downloadmate-applets-adf5920f13380611d5e5b5cb712e5b2e6b1eed9c.tar.bz2
mate-applets-adf5920f13380611d5e5b5cb712e5b2e6b1eed9c.tar.xz
cpufreq: deprecated g_type_class_add_private
Diffstat (limited to 'cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c')
-rw-r--r--cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c b/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
index 990ea702..1cb87660 100644
--- a/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
+++ b/cpufreq/src/cpufreq-selector/cpufreq-selector-sysfs.c
@@ -26,9 +26,6 @@
#include "cpufreq-selector-sysfs.h"
-#define CPUFREQ_SELECTOR_SYSFS_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), CPUFREQ_TYPE_SELECTOR_SYSFS, CPUFreqSelectorSysfsPrivate))
-
struct _CPUFreqSelectorSysfsPrivate {
GList *available_freqs;
GList *available_govs;
@@ -47,12 +44,12 @@ static gboolean cpufreq_selector_sysfs_set_governor (CPUFreqSelector
#define CPUFREQ_SYSFS_BASE_PATH "/sys/devices/system/cpu/cpu%u/cpufreq/%s"
-G_DEFINE_TYPE (CPUFreqSelectorSysfs, cpufreq_selector_sysfs, CPUFREQ_TYPE_SELECTOR)
+G_DEFINE_TYPE_WITH_PRIVATE (CPUFreqSelectorSysfs, cpufreq_selector_sysfs, CPUFREQ_TYPE_SELECTOR)
static void
cpufreq_selector_sysfs_init (CPUFreqSelectorSysfs *selector)
{
- selector->priv = CPUFREQ_SELECTOR_SYSFS_GET_PRIVATE (selector);
+ selector->priv = cpufreq_selector_sysfs_get_instance_private (selector);
selector->priv->available_freqs = NULL;
selector->priv->available_govs = NULL;
@@ -64,8 +61,6 @@ cpufreq_selector_sysfs_class_init (CPUFreqSelectorSysfsClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
CPUFreqSelectorClass *selector_class = CPUFREQ_SELECTOR_CLASS (klass);
- g_type_class_add_private (klass, sizeof (CPUFreqSelectorSysfsPrivate));
-
selector_class->set_frequency = cpufreq_selector_sysfs_set_frequency;
selector_class->set_governor = cpufreq_selector_sysfs_set_governor;