Skip to content

Commit 9578b04

Browse files
committed
Merge tag 'pm-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki: "These fix an amd-pstate cpufreq driver issues and recently introduced hibernation-related breakage. Specifics: - Make amd-pstate use device_attributes as expected by the CPU root kobject (Thomas Weißschuh) - Restore the previous behavior of resume_store() when hibernation is not available which is to return the full number of bytes that were to be written by user space (Vlastimil Babka)" * tag 'pm-6.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: amd-pstate: fix global sysfs attribute type PM: hibernate: fix resume_store() return value when hibernation not available
2 parents 360e694 + 4778e12 commit 9578b04

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,8 +1012,8 @@ static int amd_pstate_update_status(const char *buf, size_t size)
10121012
return 0;
10131013
}
10141014

1015-
static ssize_t show_status(struct kobject *kobj,
1016-
struct kobj_attribute *attr, char *buf)
1015+
static ssize_t status_show(struct device *dev,
1016+
struct device_attribute *attr, char *buf)
10171017
{
10181018
ssize_t ret;
10191019

@@ -1024,7 +1024,7 @@ static ssize_t show_status(struct kobject *kobj,
10241024
return ret;
10251025
}
10261026

1027-
static ssize_t store_status(struct kobject *a, struct kobj_attribute *b,
1027+
static ssize_t status_store(struct device *a, struct device_attribute *b,
10281028
const char *buf, size_t count)
10291029
{
10301030
char *p = memchr(buf, '\n', count);
@@ -1043,7 +1043,7 @@ cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq);
10431043
cpufreq_freq_attr_ro(amd_pstate_highest_perf);
10441044
cpufreq_freq_attr_rw(energy_performance_preference);
10451045
cpufreq_freq_attr_ro(energy_performance_available_preferences);
1046-
define_one_global_rw(status);
1046+
static DEVICE_ATTR_RW(status);
10471047

10481048
static struct freq_attr *amd_pstate_attr[] = {
10491049
&amd_pstate_max_freq,
@@ -1062,7 +1062,7 @@ static struct freq_attr *amd_pstate_epp_attr[] = {
10621062
};
10631063

10641064
static struct attribute *pstate_global_attributes[] = {
1065-
&status.attr,
1065+
&dev_attr_status.attr,
10661066
NULL
10671067
};
10681068

kernel/power/hibernate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ static ssize_t resume_store(struct kobject *kobj, struct kobj_attribute *attr,
11661166
int error;
11671167

11681168
if (!hibernation_available())
1169-
return 0;
1169+
return n;
11701170

11711171
if (len && buf[len-1] == '\n')
11721172
len--;

0 commit comments

Comments
 (0)