of: acpi: Rename of_node() and acpi_node() to to_of_node() and to_acpi_node()
Subsystems (7)
PATCH 1/1 of: acpi: Rename of_node() and acpi_node() to to_of_node() and to_acpi_node()
Commit 8a0662d9 introduced of_node and acpi_node symbols in global namespace but there were already ~63 of_node local variables or function parameters (no single acpi_node though, but anyway).
After debugging undefined but used of_node local varible (which turned out to reference static function of_node() instead) it became clear that the names for the functions are too short and too generic for global scope.
---
Compile-tested on x86_64 with ACPI and ARM with OF.
drivers/base/property.c | 26 +++++++++++++------------- drivers/gpio/gpiolib.c | 4 ++-- drivers/leds/leds-gpio.c | 2 +- include/acpi/acpi_bus.h | 2 +- include/linux/acpi.h | 4 ++-- include/linux/of.h | 4 ++-- 6 files changed, 21 insertions(+), 21 deletions(-)
drivers/base/property.c +13 -13
@@ -128,9 +128,9 @@ EXPORT_SYMBOL_GPL(device_property_present);bool fwnode_property_present (struct fwnode_handle *fwnode,const char *propname) {if (is_of_node (fwnode)) -return of_property_read_bool (of_node (fwnode), propname); +return of_property_read_bool (to_of_node (fwnode), propname);else if (is_acpi_node (fwnode)) -return !acpi_dev_prop_get (acpi_node (fwnode), propname,NULL ); +return !acpi_dev_prop_get (to_acpi_node (fwnode), propname,NULL );return !!pset_prop_get (to_pset (fwnode), propname); }
@@ -285,10 +285,10 @@ EXPORT_SYMBOL_GPL(device_property_read_string); ({ \ int _ret_; \ if (is_of_node(_fwnode_)) \ - _ret_ = OF_DEV_PROP_READ_ARRAY(of_node(_fwnode_), _propname_, \ + _ret_ = OF_DEV_PROP_READ_ARRAY(to_of_node(_fwnode_), _propname_, \ _type_, _val_, _nval_); \ else if (is_acpi_node(_fwnode_)) \ - _ret_ = acpi_dev_prop_read(acpi_node(_fwnode_), _propname_, \ + _ret_ = acpi_dev_prop_read(to_acpi_node(_fwnode_), _propname_, \ _proptype_, _val_, _nval_); \ else \ _ret_ = pset_prop_read_array(to_pset(_fwnode_), _propname_, \
@@ -424,11 +424,11 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode, {if (is_of_node (fwnode))return val ? -of_property_read_string_array (of_node (fwnode), propname, - val, nval) : -of_property_count_strings (of_node (fwnode), propname); +of_property_read_string_array (to_of_node (fwnode), + propname, val, nval) : +of_property_count_strings (to_of_node (fwnode), propname);else if (is_acpi_node (fwnode)) -return acpi_dev_prop_read (acpi_node (fwnode), propname, +return acpi_dev_prop_read (to_acpi_node (fwnode), propname,DEV_PROP_STRING , val, nval); return pset_prop_read_array(to_pset(fwnode), propname,
@@ -455,9 +455,9 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode, const char *propname, const char **val) { if (is_of_node(fwnode)) - return of_property_read_string(of_node(fwnode), propname, val); + return of_property_read_string(to_of_node(fwnode), propname, val); else if (is_acpi_node(fwnode)) - return acpi_dev_prop_read(acpi_node(fwnode), propname, + return acpi_dev_prop_read(to_acpi_node(fwnode), propname, DEV_PROP_STRING, val, 1);return -ENXIO ;
@@ -475,13 +475,13 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev,if (IS_ENABLED (CONFIG_OF ) && dev->of_node) {struct device_node *node; - node =of_get_next_available_child (dev->of_node,of_node (child)); + node =of_get_next_available_child (dev->of_node,to_of_node (child));if (node)return &node->fwnode; }else if (IS_ENABLED (CONFIG_ACPI )) {struct acpi_device *node; - node =acpi_get_next_child (dev,acpi_node (child)); + node =acpi_get_next_child (dev,to_acpi_node (child));if (node)return acpi_fwnode_handle (node); }
@@ -500,7 +500,7 @@ EXPORT_SYMBOL_GPL(device_get_next_child_node);void fwnode_handle_put (struct fwnode_handle *fwnode) {if (is_of_node (fwnode)) -of_node_put (of_node (fwnode)); +of_node_put (to_of_node (fwnode)); }EXPORT_SYMBOL_GPL (fwnode_handle_put);
drivers/gpio/gpiolib.c +2 -2
@@ -2040,14 +2040,14 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,if (is_of_node (fwnode)) {enum of_gpio_flags flags; - desc =of_get_named_gpiod_flags (of_node (fwnode), propname,0 , + desc =of_get_named_gpiod_flags (to_of_node (fwnode), propname,0 , &flags);if (!IS_ERR (desc)) active_low = flags &OF_GPIO_ACTIVE_LOW ; }else if (is_acpi_node (fwnode)) {struct acpi_gpio_info info; - desc =acpi_get_gpiod_by_index (acpi_node (fwnode), propname,0 , + desc =acpi_get_gpiod_by_index (to_acpi_node (fwnode), propname,0 , &info);if (!IS_ERR (desc)) active_low = info.active_low;
drivers/leds/leds-gpio.c +1 -1
@@ -191,7 +191,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) goto err; } - np =of_node (child); + np =to_of_node (child);if (fwnode_property_present (child,"label" )) {fwnode_property_read_string (child,"label" , &led.name);
include/acpi/acpi_bus.h +1 -1
@@ -385,7 +385,7 @@ static inline bool is_acpi_node(struct fwnode_handle *fwnode)return fwnode && fwnode->type ==FWNODE_ACPI ; } -static inline struct acpi_device *acpi_node (struct fwnode_handle *fwnode) +static inline struct acpi_device *to_acpi_node (struct fwnode_handle *fwnode) {return is_acpi_node (fwnode) ? container_of(fwnode, struct acpi_device, fwnode) : NULL;
include/linux/acpi.h +2 -2
@@ -53,7 +53,7 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)return adev ? adev->handle :NULL ; } -#define ACPI_COMPANION (dev) acpi_node((dev)->fwnode) +#define ACPI_COMPANION (dev) to_acpi_node((dev)->fwnode)#define ACPI_COMPANION_SET (dev, adev) set_primary_fwnode(dev, (adev) ? \ acpi_fwnode_handle(adev) : NULL)#define ACPI_HANDLE (dev) acpi_device_handle(ACPI_COMPANION(dev))
@@ -473,7 +473,7 @@ static inline bool is_acpi_node(struct fwnode_handle *fwnode)return false; } -static inline struct acpi_device *acpi_node (struct fwnode_handle *fwnode) +static inline struct acpi_device *to_acpi_node (struct fwnode_handle *fwnode) {return NULL ; }
include/linux/of.h +2 -2
@@ -128,7 +128,7 @@ static inline bool is_of_node(struct fwnode_handle *fwnode)return fwnode && fwnode->type ==FWNODE_OF ; } -static inline struct device_node *of_node (struct fwnode_handle *fwnode) +static inline struct device_node *to_of_node (struct fwnode_handle *fwnode) { return fwnode ? container_of(fwnode, struct device_node, fwnode) : NULL; }
@@ -387,7 +387,7 @@ static inline bool is_of_node(struct fwnode_handle *fwnode)return false; } -static inline struct device_node *of_node (struct fwnode_handle *fwnode) +static inline struct device_node *to_of_node (struct fwnode_handle *fwnode) {return NULL ; }
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
Quoted 9 lines · Alexander Sverdlin
Commit
8a0662d9introducedof_nodeandacpi_nodesymbols in global namespace but there were already ~63of_nodelocal variables or function parameters (no singleacpi_nodethough, but anyway).After debugging undefined but used
of_nodelocal varible (which turned out to reference static functionof_node()instead) it became clear that the names for the functions are too short and too generic for global scope.Signed-off-by Alexander Sverdlin <[email protected]>
Putting the whole world into the To: field of your messages is not a good idea in general.
I'm fine with this change, personally.
Does anyone in the CC list have any objections?
Quoted 177 lines
---
Compile-tested on
x86_64with ACPI and ARM with OF.drivers/base/property.c | 26 +++++++++++++------------- drivers/gpio/gpiolib.c | 4 ++-- drivers/leds/leds-gpio.c | 2 +- include/acpi/acpi_bus.h | 2 +- include/linux/acpi.h | 4 ++-- include/linux/of.h | 4 ++-- 6 files changed, 21 insertions(+), 21 deletions(-)drivers/base/property.c +13
-13@@ -128,9 +128,9 @@ EXPORT_SYMBOL_GPL(device_property_present);bool fwnode_property_present (struct fwnode_handle *fwnode,const char *propname) {if (is_of_node (fwnode)) -return of_property_read_bool (of_node (fwnode), propname); +return of_property_read_bool (to_of_node (fwnode), propname);else if (is_acpi_node (fwnode)) -return !acpi_dev_prop_get (acpi_node (fwnode), propname,NULL ); +return !acpi_dev_prop_get (to_acpi_node (fwnode), propname,NULL );return !!pset_prop_get (to_pset (fwnode), propname); }@@ -285,10 +285,10 @@ EXPORT_SYMBOL_GPL(device_property_read_string); ({ \ int _ret_; \ if (is_of_node(_fwnode_)) \ - _ret_ = OF_DEV_PROP_READ_ARRAY(of_node(_fwnode_), _propname_, \ + _ret_ = OF_DEV_PROP_READ_ARRAY(to_of_node(_fwnode_), _propname_, \ _type_, _val_, _nval_); \ else if (is_acpi_node(_fwnode_)) \ - _ret_ = acpi_dev_prop_read(acpi_node(_fwnode_), _propname_, \ + _ret_ = acpi_dev_prop_read(to_acpi_node(_fwnode_), _propname_, \ _proptype_, _val_, _nval_); \ else \ _ret_ = pset_prop_read_array(to_pset(_fwnode_), _propname_, \@@ -424,11 +424,11 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode, {if (is_of_node (fwnode))return val ? -of_property_read_string_array (of_node (fwnode), propname, - val, nval) : -of_property_count_strings (of_node (fwnode), propname); +of_property_read_string_array (to_of_node (fwnode), + propname, val, nval) : +of_property_count_strings (to_of_node (fwnode), propname);else if (is_acpi_node (fwnode)) -return acpi_dev_prop_read (acpi_node (fwnode), propname, +return acpi_dev_prop_read (to_acpi_node (fwnode), propname,DEV_PROP_STRING , val, nval); return pset_prop_read_array(to_pset(fwnode), propname,@@ -455,9 +455,9 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode, const char *propname, const char **val) { if (is_of_node(fwnode)) - return of_property_read_string(of_node(fwnode), propname, val); + return of_property_read_string(to_of_node(fwnode), propname, val); else if (is_acpi_node(fwnode)) - return acpi_dev_prop_read(acpi_node(fwnode), propname, + return acpi_dev_prop_read(to_acpi_node(fwnode), propname, DEV_PROP_STRING, val, 1);return -ENXIO ;@@ -475,13 +475,13 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev,if (IS_ENABLED (CONFIG_OF ) && dev->of_node) {struct device_node *node; - node =of_get_next_available_child (dev->of_node,of_node (child)); + node =of_get_next_available_child (dev->of_node,to_of_node (child));if (node)return &node->fwnode; }else if (IS_ENABLED (CONFIG_ACPI )) {struct acpi_device *node; - node =acpi_get_next_child (dev,acpi_node (child)); + node =acpi_get_next_child (dev,to_acpi_node (child));if (node)return acpi_fwnode_handle (node); }@@ -500,7 +500,7 @@ EXPORT_SYMBOL_GPL(device_get_next_child_node);void fwnode_handle_put (struct fwnode_handle *fwnode) {if (is_of_node (fwnode)) -of_node_put (of_node (fwnode)); +of_node_put (to_of_node (fwnode)); }EXPORT_SYMBOL_GPL (fwnode_handle_put);drivers/gpio/gpiolib.c +2
-2@@ -2040,14 +2040,14 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,if (is_of_node (fwnode)) {enum of_gpio_flags flags; - desc =of_get_named_gpiod_flags (of_node (fwnode), propname,0 , + desc =of_get_named_gpiod_flags (to_of_node (fwnode), propname,0 , &flags);if (!IS_ERR (desc)) active_low = flags &OF_GPIO_ACTIVE_LOW ; }else if (is_acpi_node (fwnode)) {struct acpi_gpio_info info; - desc =acpi_get_gpiod_by_index (acpi_node (fwnode), propname,0 , + desc =acpi_get_gpiod_by_index (to_acpi_node (fwnode), propname,0 , &info);if (!IS_ERR (desc)) active_low = info.active_low;drivers/leds/leds-gpio.c +1
-1@@ -191,7 +191,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) goto err; } - np =of_node (child); + np =to_of_node (child);if (fwnode_property_present (child,"label" )) {fwnode_property_read_string (child,"label" , &led.name);include/acpi/acpi_bus.h +1
-1@@ -385,7 +385,7 @@ static inline bool is_acpi_node(struct fwnode_handle *fwnode)return fwnode && fwnode->type ==FWNODE_ACPI ; } -static inline struct acpi_device *acpi_node (struct fwnode_handle *fwnode) +static inline struct acpi_device *to_acpi_node (struct fwnode_handle *fwnode) {return is_acpi_node (fwnode) ? container_of(fwnode, struct acpi_device, fwnode) : NULL;include/linux/acpi.h +2
-2@@ -53,7 +53,7 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)return adev ? adev->handle :NULL ; } -#define ACPI_COMPANION (dev) acpi_node((dev)->fwnode) +#define ACPI_COMPANION (dev) to_acpi_node((dev)->fwnode)#define ACPI_COMPANION_SET (dev, adev) set_primary_fwnode(dev, (adev) ? \ acpi_fwnode_handle(adev) : NULL)#define ACPI_HANDLE (dev) acpi_device_handle(ACPI_COMPANION(dev))@@ -473,7 +473,7 @@ static inline bool is_acpi_node(struct fwnode_handle *fwnode)return false; } -static inline struct acpi_device *acpi_node (struct fwnode_handle *fwnode) +static inline struct acpi_device *to_acpi_node (struct fwnode_handle *fwnode) {return NULL ; }include/linux/of.h +1
-1@@ -128,7 +128,7 @@ static inline bool is_of_node(struct fwnode_handle *fwnode)return fwnode && fwnode->type ==FWNODE_OF ; } -static inline struct device_node *of_node (struct fwnode_handle *fwnode) +static inline struct device_node *to_of_node (struct fwnode_handle *fwnode) { return fwnode ? container_of(fwnode, struct device_node, fwnode) : NULL; }
include/linux/of.h static inline bool is_of_node(struct fwnode_handle *fwnode)
Quoted 9 lines
include/linux/of.h +1
-2@@ -387,7 +387,7 @@ static inline bool is_of_node(struct fwnode_handle *fwnode)return false; } -static inline struct device_node *of_node (struct fwnode_handle *fwnode) +static inline struct device_node *to_of_node (struct fwnode_handle *fwnode) {return NULL ; } --
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
Quoted 9 lines · Rafael J. Wysocki
Quoted 8 lines · Alexander Sverdlin
Commit
8a0662d9introducedof_nodeandacpi_nodesymbols in global namespace but there were already ~63of_nodelocal variables or function parameters (no singleacpi_nodethough, but anyway).After debugging undefined but used
of_nodelocal varible (which turned out to reference static functionof_node()instead) it became clear that the names for the functions are too short and too generic for global scope.
Quoted 8 lines
Quoted 1 line
Signed-off-by Alexander Sverdlin <[email protected]>Putting the whole world into the To: field of your messages is not a good idea in general.
I'm fine with this change, personally.
Does anyone in the CC list have any objections?
No objections apparently.
OK, I've queued this one up for the next PM+ACPI pull request, thanks!
Quoted 188 lines
Quoted 188 lines
---
Compile-tested on
x86_64with ACPI and ARM with OF.drivers/base/property.c | 26 +++++++++++++------------- drivers/gpio/gpiolib.c | 4 ++-- drivers/leds/leds-gpio.c | 2 +- include/acpi/acpi_bus.h | 2 +- include/linux/acpi.h | 4 ++-- include/linux/of.h | 4 ++-- 6 files changed, 21 insertions(+), 21 deletions(-)drivers/base/property.c +13
-13@@ -128,9 +128,9 @@ EXPORT_SYMBOL_GPL(device_property_present);bool fwnode_property_present (struct fwnode_handle *fwnode,const char *propname) {if (is_of_node (fwnode)) -return of_property_read_bool (of_node (fwnode), propname); +return of_property_read_bool (to_of_node (fwnode), propname);else if (is_acpi_node (fwnode)) -return !acpi_dev_prop_get (acpi_node (fwnode), propname,NULL ); +return !acpi_dev_prop_get (to_acpi_node (fwnode), propname,NULL );return !!pset_prop_get (to_pset (fwnode), propname); }@@ -285,10 +285,10 @@ EXPORT_SYMBOL_GPL(device_property_read_string); ({ \ int _ret_; \ if (is_of_node(_fwnode_)) \ - _ret_ = OF_DEV_PROP_READ_ARRAY(of_node(_fwnode_), _propname_, \ + _ret_ = OF_DEV_PROP_READ_ARRAY(to_of_node(_fwnode_), _propname_, \ _type_, _val_, _nval_); \ else if (is_acpi_node(_fwnode_)) \ - _ret_ = acpi_dev_prop_read(acpi_node(_fwnode_), _propname_, \ + _ret_ = acpi_dev_prop_read(to_acpi_node(_fwnode_), _propname_, \ _proptype_, _val_, _nval_); \ else \ _ret_ = pset_prop_read_array(to_pset(_fwnode_), _propname_, \@@ -424,11 +424,11 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode, {if (is_of_node (fwnode))return val ? -of_property_read_string_array (of_node (fwnode), propname, - val, nval) : -of_property_count_strings (of_node (fwnode), propname); +of_property_read_string_array (to_of_node (fwnode), + propname, val, nval) : +of_property_count_strings (to_of_node (fwnode), propname);else if (is_acpi_node (fwnode)) -return acpi_dev_prop_read (acpi_node (fwnode), propname, +return acpi_dev_prop_read (to_acpi_node (fwnode), propname,DEV_PROP_STRING , val, nval); return pset_prop_read_array(to_pset(fwnode), propname,@@ -455,9 +455,9 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode, const char *propname, const char **val) { if (is_of_node(fwnode)) - return of_property_read_string(of_node(fwnode), propname, val); + return of_property_read_string(to_of_node(fwnode), propname, val); else if (is_acpi_node(fwnode)) - return acpi_dev_prop_read(acpi_node(fwnode), propname, + return acpi_dev_prop_read(to_acpi_node(fwnode), propname, DEV_PROP_STRING, val, 1);return -ENXIO ;@@ -475,13 +475,13 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev,if (IS_ENABLED (CONFIG_OF ) && dev->of_node) {struct device_node *node; - node =of_get_next_available_child (dev->of_node,of_node (child)); + node =of_get_next_available_child (dev->of_node,to_of_node (child));if (node)return &node->fwnode; }else if (IS_ENABLED (CONFIG_ACPI )) {struct acpi_device *node; - node =acpi_get_next_child (dev,acpi_node (child)); + node =acpi_get_next_child (dev,to_acpi_node (child));if (node)return acpi_fwnode_handle (node); }@@ -500,7 +500,7 @@ EXPORT_SYMBOL_GPL(device_get_next_child_node);void fwnode_handle_put (struct fwnode_handle *fwnode) {if (is_of_node (fwnode)) -of_node_put (of_node (fwnode)); +of_node_put (to_of_node (fwnode)); }EXPORT_SYMBOL_GPL (fwnode_handle_put);drivers/gpio/gpiolib.c +2
-2@@ -2040,14 +2040,14 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,if (is_of_node (fwnode)) {enum of_gpio_flags flags; - desc =of_get_named_gpiod_flags (of_node (fwnode), propname,0 , + desc =of_get_named_gpiod_flags (to_of_node (fwnode), propname,0 , &flags);if (!IS_ERR (desc)) active_low = flags &OF_GPIO_ACTIVE_LOW ; }else if (is_acpi_node (fwnode)) {struct acpi_gpio_info info; - desc =acpi_get_gpiod_by_index (acpi_node (fwnode), propname,0 , + desc =acpi_get_gpiod_by_index (to_acpi_node (fwnode), propname,0 , &info);if (!IS_ERR (desc)) active_low = info.active_low;drivers/leds/leds-gpio.c +1
-1@@ -191,7 +191,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) goto err; } - np =of_node (child); + np =to_of_node (child);if (fwnode_property_present (child,"label" )) {fwnode_property_read_string (child,"label" , &led.name);include/acpi/acpi_bus.h +1
-1@@ -385,7 +385,7 @@ static inline bool is_acpi_node(struct fwnode_handle *fwnode)return fwnode && fwnode->type ==FWNODE_ACPI ; } -static inline struct acpi_device *acpi_node (struct fwnode_handle *fwnode) +static inline struct acpi_device *to_acpi_node (struct fwnode_handle *fwnode) {return is_acpi_node (fwnode) ? container_of(fwnode, struct acpi_device, fwnode) : NULL;include/linux/acpi.h +2
-2@@ -53,7 +53,7 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)return adev ? adev->handle :NULL ; } -#define ACPI_COMPANION (dev) acpi_node((dev)->fwnode) +#define ACPI_COMPANION (dev) to_acpi_node((dev)->fwnode)#define ACPI_COMPANION_SET (dev, adev) set_primary_fwnode(dev, (adev) ? \ acpi_fwnode_handle(adev) : NULL)#define ACPI_HANDLE (dev) acpi_device_handle(ACPI_COMPANION(dev))@@ -473,7 +473,7 @@ static inline bool is_acpi_node(struct fwnode_handle *fwnode)return false; } -static inline struct acpi_device *acpi_node (struct fwnode_handle *fwnode) +static inline struct acpi_device *to_acpi_node (struct fwnode_handle *fwnode) {return NULL ; }include/linux/of.h +2
-3@@ -128,7 +128,7 @@ static inline bool is_of_node(struct fwnode_handle *fwnode)return fwnode && fwnode->type ==FWNODE_OF ; } -static inline struct device_node *of_node (struct fwnode_handle *fwnode) +static inline struct device_node *to_of_node (struct fwnode_handle *fwnode) { return fwnode ? container_of(fwnode, struct device_node, fwnode) : NULL; }@@ -387,7 +387,7 @@ static inline bool is_of_node(struct fwnode_handle *fwnode)return false; } -static inline struct device_node *of_node (struct fwnode_handle *fwnode) +static inline struct device_node *to_of_node (struct fwnode_handle *fwnode) {return NULL ; } --
Grant Likely
Acked-byQuoted 15 lines · Rafael J. Wysocki
Quoted 14 lines · Rafael J. Wysocki
Quoted 9 lines · Alexander Sverdlin
Commit
8a0662d9introducedof_nodeandacpi_nodesymbols in global namespace but there were already ~63of_nodelocal variables or function parameters (no singleacpi_nodethough, but anyway).After debugging undefined but used
of_nodelocal varible (which turned out to reference static functionof_node()instead) it became clear that the names for the functions are too short and too generic for global scope.Signed-off-by Alexander Sverdlin <[email protected]>Putting the whole world into the To: field of your messages is not a good idea in general.
Quoted 7 lines
Quoted 3 lines
I'm fine with this change, personally.
Does anyone in the CC list have any objections?
No objections apparently.
OK, I've queued this one up for the next PM+ACPI pull request, thanks!
g.
Quoted 190 lines
Quoted 189 lines
Quoted 189 lines
---
Compile-tested on
x86_64with ACPI and ARM with OF.drivers/base/property.c | 26 +++++++++++++------------- drivers/gpio/gpiolib.c | 4 ++-- drivers/leds/leds-gpio.c | 2 +- include/acpi/acpi_bus.h | 2 +- include/linux/acpi.h | 4 ++-- include/linux/of.h | 4 ++-- 6 files changed, 21 insertions(+), 21 deletions(-)drivers/base/property.c +13
-13@@ -128,9 +128,9 @@ EXPORT_SYMBOL_GPL(device_property_present);bool fwnode_property_present (struct fwnode_handle *fwnode,const char *propname) {if (is_of_node (fwnode)) -return of_property_read_bool (of_node (fwnode), propname); +return of_property_read_bool (to_of_node (fwnode), propname);else if (is_acpi_node (fwnode)) -return !acpi_dev_prop_get (acpi_node (fwnode), propname,NULL ); +return !acpi_dev_prop_get (to_acpi_node (fwnode), propname,NULL );return !!pset_prop_get (to_pset (fwnode), propname); }@@ -285,10 +285,10 @@ EXPORT_SYMBOL_GPL(device_property_read_string); ({ \ int _ret_; \ if (is_of_node(_fwnode_)) \ - _ret_ = OF_DEV_PROP_READ_ARRAY(of_node(_fwnode_), _propname_, \ + _ret_ = OF_DEV_PROP_READ_ARRAY(to_of_node(_fwnode_), _propname_, \ _type_, _val_, _nval_); \ else if (is_acpi_node(_fwnode_)) \ - _ret_ = acpi_dev_prop_read(acpi_node(_fwnode_), _propname_, \ + _ret_ = acpi_dev_prop_read(to_acpi_node(_fwnode_), _propname_, \ _proptype_, _val_, _nval_); \ else \ _ret_ = pset_prop_read_array(to_pset(_fwnode_), _propname_, \@@ -424,11 +424,11 @@ int fwnode_property_read_string_array(struct fwnode_handle *fwnode, {if (is_of_node (fwnode))return val ? -of_property_read_string_array (of_node (fwnode), propname, - val, nval) : -of_property_count_strings (of_node (fwnode), propname); +of_property_read_string_array (to_of_node (fwnode), + propname, val, nval) : +of_property_count_strings (to_of_node (fwnode), propname);else if (is_acpi_node (fwnode)) -return acpi_dev_prop_read (acpi_node (fwnode), propname, +return acpi_dev_prop_read (to_acpi_node (fwnode), propname,DEV_PROP_STRING , val, nval); return pset_prop_read_array(to_pset(fwnode), propname,@@ -455,9 +455,9 @@ int fwnode_property_read_string(struct fwnode_handle *fwnode, const char *propname, const char **val) { if (is_of_node(fwnode)) - return of_property_read_string(of_node(fwnode), propname, val); + return of_property_read_string(to_of_node(fwnode), propname, val); else if (is_acpi_node(fwnode)) - return acpi_dev_prop_read(acpi_node(fwnode), propname, + return acpi_dev_prop_read(to_acpi_node(fwnode), propname, DEV_PROP_STRING, val, 1);return -ENXIO ;@@ -475,13 +475,13 @@ struct fwnode_handle *device_get_next_child_node(struct device *dev,if (IS_ENABLED (CONFIG_OF ) && dev->of_node) {struct device_node *node; - node =of_get_next_available_child (dev->of_node,of_node (child)); + node =of_get_next_available_child (dev->of_node,to_of_node (child));if (node)return &node->fwnode; }else if (IS_ENABLED (CONFIG_ACPI )) {struct acpi_device *node; - node =acpi_get_next_child (dev,acpi_node (child)); + node =acpi_get_next_child (dev,to_acpi_node (child));if (node)return acpi_fwnode_handle (node); }@@ -500,7 +500,7 @@ EXPORT_SYMBOL_GPL(device_get_next_child_node);void fwnode_handle_put (struct fwnode_handle *fwnode) {if (is_of_node (fwnode)) -of_node_put (of_node (fwnode)); +of_node_put (to_of_node (fwnode)); }EXPORT_SYMBOL_GPL (fwnode_handle_put);drivers/gpio/gpiolib.c +2
-2@@ -2040,14 +2040,14 @@ struct gpio_desc *fwnode_get_named_gpiod(struct fwnode_handle *fwnode,if (is_of_node (fwnode)) {enum of_gpio_flags flags; - desc =of_get_named_gpiod_flags (of_node (fwnode), propname,0 , + desc =of_get_named_gpiod_flags (to_of_node (fwnode), propname,0 , &flags);if (!IS_ERR (desc)) active_low = flags &OF_GPIO_ACTIVE_LOW ; }else if (is_acpi_node (fwnode)) {struct acpi_gpio_info info; - desc =acpi_get_gpiod_by_index (acpi_node (fwnode), propname,0 , + desc =acpi_get_gpiod_by_index (to_acpi_node (fwnode), propname,0 , &info);if (!IS_ERR (desc)) active_low = info.active_low;drivers/leds/leds-gpio.c +1
-1@@ -191,7 +191,7 @@ static struct gpio_leds_priv *gpio_leds_create(struct platform_device *pdev) goto err; } - np =of_node (child); + np =to_of_node (child);if (fwnode_property_present (child,"label" )) {fwnode_property_read_string (child,"label" , &led.name);include/acpi/acpi_bus.h +1
-1@@ -385,7 +385,7 @@ static inline bool is_acpi_node(struct fwnode_handle *fwnode)return fwnode && fwnode->type ==FWNODE_ACPI ; } -static inline struct acpi_device *acpi_node (struct fwnode_handle *fwnode) +static inline struct acpi_device *to_acpi_node (struct fwnode_handle *fwnode) {return is_acpi_node (fwnode) ? container_of(fwnode, struct acpi_device, fwnode) : NULL;include/linux/acpi.h +2
-2@@ -53,7 +53,7 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)return adev ? adev->handle :NULL ; } -#define ACPI_COMPANION (dev) acpi_node((dev)->fwnode) +#define ACPI_COMPANION (dev) to_acpi_node((dev)->fwnode)#define ACPI_COMPANION_SET (dev, adev) set_primary_fwnode(dev, (adev) ? \ acpi_fwnode_handle(adev) : NULL)#define ACPI_HANDLE (dev) acpi_device_handle(ACPI_COMPANION(dev))@@ -473,7 +473,7 @@ static inline bool is_acpi_node(struct fwnode_handle *fwnode)return false; } -static inline struct acpi_device *acpi_node (struct fwnode_handle *fwnode) +static inline struct acpi_device *to_acpi_node (struct fwnode_handle *fwnode) {return NULL ; }include/linux/of.h +2
-3@@ -128,7 +128,7 @@ static inline bool is_of_node(struct fwnode_handle *fwnode)return fwnode && fwnode->type ==FWNODE_OF ; } -static inline struct device_node *of_node (struct fwnode_handle *fwnode) +static inline struct device_node *to_of_node (struct fwnode_handle *fwnode) { return fwnode ? container_of(fwnode, struct device_node, fwnode) : NULL; }@@ -387,7 +387,7 @@ static inline bool is_of_node(struct fwnode_handle *fwnode)return false; } -static inline struct device_node *of_node (struct fwnode_handle *fwnode) +static inline struct device_node *to_of_node (struct fwnode_handle *fwnode) {return NULL ; } --