software node: Make argument to to_software_node const
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 3 Oct 2019 12:32:09 +0000 (15:32 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 11 Oct 2019 09:26:55 +0000 (11:26 +0200)
to_software_node() does not need to modify the fwnode_handle it operates
on; therefore make it const. This allows passing a const fwnode_handle to
to_software_node().

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/swnode.c
include/linux/property.h

index d5b4905e2adbd7f324054937adf1fd7253017e8c..9cde143201f5f44f6aaa2a5998d152db0cdc396e 100644 (file)
@@ -71,9 +71,9 @@ software_node_to_swnode(const struct software_node *node)
        return swnode;
 }
 
-const struct software_node *to_software_node(struct fwnode_handle *fwnode)
+const struct software_node *to_software_node(const struct fwnode_handle *fwnode)
 {
-       struct swnode *swnode = to_swnode(fwnode);
+       const struct swnode *swnode = to_swnode(fwnode);
 
        return swnode ? swnode->node : NULL;
 }
index 9b3d4ca3a73a9eca0266e16c64c933034d7fb3a3..87d795a1e2d647a2ee34b3b7008b5e33b6110d20 100644 (file)
@@ -418,7 +418,8 @@ struct software_node {
 };
 
 bool is_software_node(const struct fwnode_handle *fwnode);
-const struct software_node *to_software_node(struct fwnode_handle *fwnode);
+const struct software_node *
+to_software_node(const struct fwnode_handle *fwnode);
 struct fwnode_handle *software_node_fwnode(const struct software_node *node);
 
 const struct software_node *