public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tero Kristo <tero.kristo@linux.intel.com>
To: hdegoede@redhat.com, srinivas.pandruvada@linux.intel.com,
	ilpo.jarvinen@linux.intel.com
Cc: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org
Subject: [PATCH 7/7] platform/x86/intel-uncore-freq: Use generic helpers for current frequency
Date: Mon, 17 Jun 2024 09:04:40 +0300	[thread overview]
Message-ID: <20240617060708.892981-8-tero.kristo@linux.intel.com> (raw)
In-Reply-To: <20240617060708.892981-1-tero.kristo@linux.intel.com>

Use the generic sysfs helpers for reading the current frequency also,
and remove the custom ones.

No functional change intended.

Signed-off-by: Tero Kristo <tero.kristo@linux.intel.com>
---
 .../uncore-frequency-common.c                 | 25 +------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
index 9356a0f322e6..4e880585cbe4 100644
--- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
+++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c
@@ -76,20 +76,6 @@ static ssize_t store_attr(struct uncore_data *data, const char *buf, ssize_t cou
 	return count;
 }
 
-static ssize_t show_perf_status_freq_khz(struct uncore_data *data, char *buf)
-{
-	unsigned int freq;
-	int ret;
-
-	mutex_lock(&uncore_lock);
-	ret = uncore_read(data, &freq, UNCORE_INDEX_CURRENT_FREQ);
-	mutex_unlock(&uncore_lock);
-	if (ret)
-		return ret;
-
-	return sprintf(buf, "%u\n", freq);
-}
-
 #define store_uncore_attr(name, index)					\
 	static ssize_t store_##name(struct kobject *kobj,		\
 				     struct kobj_attribute *attr,	\
@@ -109,22 +95,13 @@ static ssize_t show_perf_status_freq_khz(struct uncore_data *data, char *buf)
 		return show_attr(data, buf, index);			\
 	}
 
-#define show_uncore_perf_status(name)					\
-	static ssize_t show_##name(struct kobject *kobj,		\
-				   struct kobj_attribute *attr, char *buf)\
-	{                                                               \
-		struct uncore_data *data = container_of(attr, struct uncore_data, name##_kobj_attr);\
-									\
-		return show_perf_status_freq_khz(data, buf); \
-	}
-
 store_uncore_attr(min_freq_khz, UNCORE_INDEX_MIN_FREQ);
 store_uncore_attr(max_freq_khz, UNCORE_INDEX_MAX_FREQ);
 
 show_uncore_attr(min_freq_khz, UNCORE_INDEX_MIN_FREQ);
 show_uncore_attr(max_freq_khz, UNCORE_INDEX_MAX_FREQ);
 
-show_uncore_perf_status(current_freq_khz);
+show_uncore_attr(current_freq_khz, UNCORE_INDEX_CURRENT_FREQ);
 
 #define show_uncore_data(member_name)					\
 	static ssize_t show_##member_name(struct kobject *kobj,	\
-- 
2.43.0


  parent reply	other threads:[~2024-06-17  6:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-17  6:04 [PATCH 0/7] platform/x86/inte-uncore-freq: Cleanups Tero Kristo
2024-06-17  6:04 ` [PATCH 1/7] platform/x86/intel-uncore-freq: Re-arrange bit masks Tero Kristo
2024-06-17  6:04 ` [PATCH 2/7] platform/x86/intel-uncore-freq: Get rid of magic values Tero Kristo
2024-06-17  6:04 ` [PATCH 3/7] platform/x86/intel-uncore-freq: Get rid of magic min_max argument Tero Kristo
2024-06-17  6:04 ` [PATCH 4/7] platform/x86/intel-uncore-freq: Use uncore_index with read_control_freq Tero Kristo
2024-06-17  6:04 ` [PATCH 5/7] platform/x86/intel-uncore-freq: Get rid of uncore_read_freq driver API Tero Kristo
2024-06-17  6:04 ` [PATCH 6/7] platform/x86/intel-uncore-freq: Rename the sysfs helper macro names Tero Kristo
2024-06-17  6:04 ` Tero Kristo [this message]
2024-06-17  9:06 ` [PATCH 0/7] platform/x86/inte-uncore-freq: Cleanups srinivas pandruvada
2024-06-18 10:00 ` Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240617060708.892981-8-tero.kristo@linux.intel.com \
    --to=tero.kristo@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox