Skip to content

Commit 8b30d2a

Browse files
committed
Merge branches 'acpi-x86', 'acpi-platform-profile', 'acpi-apei' and 'acpi-misc'
Merge an ACPI CPPC update, ACPI platform-profile driver updates, an ACPI APEI update and a MAINTAINERS update related to ACPI for 6.15-rc1: - Add a missing header file include to the x86 arch CPPC code (Mario Limonciello). - Rework the sysfs attributes implementation in the ACPI platform-profile driver and improve the unregistration code in it (Nathan Chancellor, Kurt Borja). - Prevent the ACPI HED driver from being built as a module and change its initcall level to subsys_initcall to avoid initialization ordering issues related to it (Xiaofei Tan). - Update a maintainer email address in the ACPI PMIC entry in MAINTAINERS (Mika Westerberg). * acpi-x86: x86/ACPI: CPPC: Add missing include * acpi-platform-profile: ACPI: platform_profile: Improve platform_profile_unregister() ACPI: platform-profile: Fix CFI violation when accessing sysfs files * acpi-apei: ACPI: HED: Always initialize before evged * acpi-misc: MAINTAINERS: Use my kernel.org address for ACPI PMIC work
5 parents 1bca17e + c9e6f7f + f316178 + cccf6ee + 18de61d commit 8b30d2a

File tree

6 files changed

+33
-27
lines changed

6 files changed

+33
-27
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ ACPI PMIC DRIVERS
355355
M: "Rafael J. Wysocki" <rafael@kernel.org>
356356
M: Len Brown <lenb@kernel.org>
357357
R: Andy Shevchenko <andy@kernel.org>
358-
R: Mika Westerberg <mika.westerberg@linux.intel.com>
358+
R: Mika Westerberg <westeri@kernel.org>
359359
L: linux-acpi@vger.kernel.org
360360
S: Supported
361361
Q: https://patchwork.kernel.org/project/linux-acpi/list/

arch/x86/kernel/acpi/cppc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Copyright (c) 2016, Intel Corporation.
55
*/
66

7+
#include <linux/bitfield.h>
8+
79
#include <acpi/cppc_acpi.h>
810
#include <asm/msr.h>
911
#include <asm/processor.h>

drivers/acpi/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ config ACPI_SBS
452452
the modules will be called sbs and sbshc.
453453

454454
config ACPI_HED
455-
tristate "Hardware Error Device"
455+
bool "Hardware Error Device"
456456
help
457457
This driver supports the Hardware Error Device (PNP0C33),
458458
which is used to report some hardware errors notified via

drivers/acpi/hed.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ static struct acpi_driver acpi_hed_driver = {
8080
.remove = acpi_hed_remove,
8181
},
8282
};
83-
module_acpi_driver(acpi_hed_driver);
83+
84+
static int __init acpi_hed_driver_init(void)
85+
{
86+
return acpi_bus_register_driver(&acpi_hed_driver);
87+
}
88+
subsys_initcall(acpi_hed_driver_init);
8489

8590
MODULE_AUTHOR("Huang Ying");
8691
MODULE_DESCRIPTION("ACPI Hardware Error Device Driver");

drivers/acpi/platform_profile.c

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,14 @@ static int _remove_hidden_choices(struct device *dev, void *arg)
289289

290290
/**
291291
* platform_profile_choices_show - Show the available profile choices for legacy sysfs interface
292-
* @dev: The device
292+
* @kobj: The kobject
293293
* @attr: The attribute
294294
* @buf: The buffer to write to
295295
*
296296
* Return: The number of bytes written
297297
*/
298-
static ssize_t platform_profile_choices_show(struct device *dev,
299-
struct device_attribute *attr,
298+
static ssize_t platform_profile_choices_show(struct kobject *kobj,
299+
struct kobj_attribute *attr,
300300
char *buf)
301301
{
302302
struct aggregate_choices_data data = {
@@ -371,14 +371,14 @@ static int _store_and_notify(struct device *dev, void *data)
371371

372372
/**
373373
* platform_profile_show - Show the current profile for legacy sysfs interface
374-
* @dev: The device
374+
* @kobj: The kobject
375375
* @attr: The attribute
376376
* @buf: The buffer to write to
377377
*
378378
* Return: The number of bytes written
379379
*/
380-
static ssize_t platform_profile_show(struct device *dev,
381-
struct device_attribute *attr,
380+
static ssize_t platform_profile_show(struct kobject *kobj,
381+
struct kobj_attribute *attr,
382382
char *buf)
383383
{
384384
enum platform_profile_option profile = PLATFORM_PROFILE_LAST;
@@ -400,15 +400,15 @@ static ssize_t platform_profile_show(struct device *dev,
400400

401401
/**
402402
* platform_profile_store - Set the profile for legacy sysfs interface
403-
* @dev: The device
403+
* @kobj: The kobject
404404
* @attr: The attribute
405405
* @buf: The buffer to read from
406406
* @count: The number of bytes to read
407407
*
408408
* Return: The number of bytes read
409409
*/
410-
static ssize_t platform_profile_store(struct device *dev,
411-
struct device_attribute *attr,
410+
static ssize_t platform_profile_store(struct kobject *kobj,
411+
struct kobj_attribute *attr,
412412
const char *buf, size_t count)
413413
{
414414
struct aggregate_choices_data data = {
@@ -442,12 +442,12 @@ static ssize_t platform_profile_store(struct device *dev,
442442
return count;
443443
}
444444

445-
static DEVICE_ATTR_RO(platform_profile_choices);
446-
static DEVICE_ATTR_RW(platform_profile);
445+
static struct kobj_attribute attr_platform_profile_choices = __ATTR_RO(platform_profile_choices);
446+
static struct kobj_attribute attr_platform_profile = __ATTR_RW(platform_profile);
447447

448448
static struct attribute *platform_profile_attrs[] = {
449-
&dev_attr_platform_profile_choices.attr,
450-
&dev_attr_platform_profile.attr,
449+
&attr_platform_profile_choices.attr,
450+
&attr_platform_profile.attr,
451451
NULL
452452
};
453453

@@ -627,24 +627,23 @@ EXPORT_SYMBOL_GPL(platform_profile_register);
627627
/**
628628
* platform_profile_remove - Unregisters a platform profile class device
629629
* @dev: Class device
630-
*
631-
* Return: 0
632630
*/
633-
int platform_profile_remove(struct device *dev)
631+
void platform_profile_remove(struct device *dev)
634632
{
635-
struct platform_profile_handler *pprof = to_pprof_handler(dev);
636-
int id;
633+
struct platform_profile_handler *pprof;
634+
635+
if (IS_ERR_OR_NULL(dev))
636+
return;
637+
638+
pprof = to_pprof_handler(dev);
639+
637640
guard(mutex)(&profile_lock);
638641

639-
id = pprof->minor;
642+
ida_free(&platform_profile_ida, pprof->minor);
640643
device_unregister(&pprof->dev);
641-
ida_free(&platform_profile_ida, id);
642644

643645
sysfs_notify(acpi_kobj, NULL, "platform_profile");
644-
645646
sysfs_update_group(acpi_kobj, &platform_profile_group);
646-
647-
return 0;
648647
}
649648
EXPORT_SYMBOL_GPL(platform_profile_remove);
650649

include/linux/platform_profile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct platform_profile_ops {
5050
struct device *platform_profile_register(struct device *dev, const char *name,
5151
void *drvdata,
5252
const struct platform_profile_ops *ops);
53-
int platform_profile_remove(struct device *dev);
53+
void platform_profile_remove(struct device *dev);
5454
struct device *devm_platform_profile_register(struct device *dev, const char *name,
5555
void *drvdata,
5656
const struct platform_profile_ops *ops);

0 commit comments

Comments
 (0)