[PATCH 1/7] ACPI: Constify acpi_get_next_subnode() fwnode argument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




This is preparation for making fwnode arguments const for fwnode ops.

Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
---
 drivers/acpi/property.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index e90f674..bfa726c 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -900,12 +900,14 @@ int acpi_node_prop_read(struct fwnode_handle *fwnode,  const char *propname,
 struct fwnode_handle *acpi_get_next_subnode(struct fwnode_handle *fwnode,
 					    struct fwnode_handle *child)
 {
-	struct acpi_device *adev = to_acpi_device_node(fwnode);
-	struct list_head *head, *next;
+	const struct acpi_device *adevc = to_acpi_device_node(fwnode);
+	struct acpi_device *adev = NULL;
+	const struct list_head *head;
+	struct list_head *next;
 
 	if (!child || child->type == FWNODE_ACPI) {
-		if (adev)
-			head = &adev->children;
+		if (adevc)
+			head = &adevc->children;
 		else
 			goto nondev;
 
@@ -928,11 +930,13 @@ struct fwnode_handle *acpi_get_next_subnode(struct fwnode_handle *fwnode,
 
  nondev:
 	if (!child || child->type == FWNODE_ACPI_DATA) {
-		struct acpi_data_node *data = to_acpi_data_node(fwnode);
+		const struct acpi_data_node *data = to_acpi_data_node(fwnode);
 		struct acpi_data_node *dn;
 
 		if (adev)
 			head = &adev->data.subnodes;
+		else if (adevc)
+			head = &adevc->data.subnodes;
 		else if (data)
 			head = &data->data.subnodes;
 		else
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux