Skip to content

Commit c65da8e

Browse files
committed
Merge tag 'acpi-4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "These fix the initialization of resources in the ACPI WDAT watchdog driver, a recent regression in the ACPI device properties handling, a recent change in behavior causing the ACPI_HANDLE() macro to only work for GPL code and create a MAINTAINERS entry for ACPI PMIC drivers in order to specify the official reviewers for that code. Specifics: - Fix the initialization of resources in the ACPI WDAT watchdog driver that uses unititialized memory which causes compiler warnings to be triggered (Arnd Bergmann). - Fix a recent regression in the ACPI device properties handling that causes some device properties data to be skipped during enumeration (Sakari Ailus). - Fix a recent change in behavior that caused the ACPI_HANDLE() macro to stop working for non-GPL code which is a problem for the NVidia binary graphics driver, for example (John Hubbard). - Add a MAINTAINERS entry for the ACPI PMIC drivers to specify the official reviewers for that code (Rafael Wysocki)" * tag 'acpi-4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: properties: Return _DSD hierarchical extension (data) sub-nodes correctly ACPI / bus: Make ACPI_HANDLE() work for non-GPL code again ACPI / watchdog: properly initialize resources ACPI / PMIC: Add code reviewers to MAINTAINERS
2 parents 6876eb3 + 672d0e4 commit c65da8e

File tree

4 files changed

+36
-20
lines changed

4 files changed

+36
-20
lines changed

MAINTAINERS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,18 @@ L: [email protected]
352352
S: Maintained
353353
F: drivers/acpi/arm64
354354

355+
ACPI PMIC DRIVERS
356+
M: "Rafael J. Wysocki" <[email protected]>
357+
M: Len Brown <[email protected]>
358+
R: Andy Shevchenko <[email protected]>
359+
R: Mika Westerberg <[email protected]>
360+
361+
Q: https://patchwork.kernel.org/project/linux-acpi/list/
362+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
363+
B: https://bugzilla.kernel.org
364+
S: Supported
365+
F: drivers/acpi/pmic/
366+
355367
ACPI THERMAL DRIVER
356368
M: Zhang Rui <[email protected]>
357369

drivers/acpi/acpi_watchdog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void __init acpi_watchdog_init(void)
6666
for (i = 0; i < wdat->entries; i++) {
6767
const struct acpi_generic_address *gas;
6868
struct resource_entry *rentry;
69-
struct resource res;
69+
struct resource res = {};
7070
bool found;
7171

7272
gas = &entries[i].register_region;

drivers/acpi/property.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -908,11 +908,12 @@ struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
908908
struct fwnode_handle *child)
909909
{
910910
const struct acpi_device *adev = to_acpi_device_node(fwnode);
911-
struct acpi_device *child_adev = NULL;
912911
const struct list_head *head;
913912
struct list_head *next;
914913

915914
if (!child || is_acpi_device_node(child)) {
915+
struct acpi_device *child_adev;
916+
916917
if (adev)
917918
head = &adev->children;
918919
else
@@ -922,8 +923,8 @@ struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
922923
goto nondev;
923924

924925
if (child) {
925-
child_adev = to_acpi_device_node(child);
926-
next = child_adev->node.next;
926+
adev = to_acpi_device_node(child);
927+
next = adev->node.next;
927928
if (next == head) {
928929
child = NULL;
929930
goto nondev;
@@ -941,8 +942,8 @@ struct fwnode_handle *acpi_get_next_subnode(const struct fwnode_handle *fwnode,
941942
const struct acpi_data_node *data = to_acpi_data_node(fwnode);
942943
struct acpi_data_node *dn;
943944

944-
if (child_adev)
945-
head = &child_adev->data.subnodes;
945+
if (adev)
946+
head = &adev->data.subnodes;
946947
else if (data)
947948
head = &data->data.subnodes;
948949
else
@@ -1293,3 +1294,16 @@ static int acpi_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
12931294
DECLARE_ACPI_FWNODE_OPS(acpi_device_fwnode_ops);
12941295
DECLARE_ACPI_FWNODE_OPS(acpi_data_fwnode_ops);
12951296
const struct fwnode_operations acpi_static_fwnode_ops;
1297+
1298+
bool is_acpi_device_node(const struct fwnode_handle *fwnode)
1299+
{
1300+
return !IS_ERR_OR_NULL(fwnode) &&
1301+
fwnode->ops == &acpi_device_fwnode_ops;
1302+
}
1303+
EXPORT_SYMBOL(is_acpi_device_node);
1304+
1305+
bool is_acpi_data_node(const struct fwnode_handle *fwnode)
1306+
{
1307+
return !IS_ERR_OR_NULL(fwnode) && fwnode->ops == &acpi_data_fwnode_ops;
1308+
}
1309+
EXPORT_SYMBOL(is_acpi_data_node);

include/acpi/acpi_bus.h

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -399,17 +399,12 @@ extern const struct fwnode_operations acpi_device_fwnode_ops;
399399
extern const struct fwnode_operations acpi_data_fwnode_ops;
400400
extern const struct fwnode_operations acpi_static_fwnode_ops;
401401

402+
bool is_acpi_device_node(const struct fwnode_handle *fwnode);
403+
bool is_acpi_data_node(const struct fwnode_handle *fwnode);
404+
402405
static inline bool is_acpi_node(const struct fwnode_handle *fwnode)
403406
{
404-
return !IS_ERR_OR_NULL(fwnode) &&
405-
(fwnode->ops == &acpi_device_fwnode_ops
406-
|| fwnode->ops == &acpi_data_fwnode_ops);
407-
}
408-
409-
static inline bool is_acpi_device_node(const struct fwnode_handle *fwnode)
410-
{
411-
return !IS_ERR_OR_NULL(fwnode) &&
412-
fwnode->ops == &acpi_device_fwnode_ops;
407+
return (is_acpi_device_node(fwnode) || is_acpi_data_node(fwnode));
413408
}
414409

415410
#define to_acpi_device_node(__fwnode) \
@@ -422,11 +417,6 @@ static inline bool is_acpi_device_node(const struct fwnode_handle *fwnode)
422417
NULL; \
423418
})
424419

425-
static inline bool is_acpi_data_node(const struct fwnode_handle *fwnode)
426-
{
427-
return !IS_ERR_OR_NULL(fwnode) && fwnode->ops == &acpi_data_fwnode_ops;
428-
}
429-
430420
#define to_acpi_data_node(__fwnode) \
431421
({ \
432422
typeof(__fwnode) __to_acpi_data_node_fwnode = __fwnode; \

0 commit comments

Comments
 (0)