spmi: rename spmi device lookup helper
authorJohan Hovold <johan+linaro@kernel.org>
Tue, 3 Oct 2023 15:29:27 +0000 (17:29 +0200)
committerLee Jones <lee@kernel.org>
Wed, 1 Nov 2023 10:02:18 +0000 (10:02 +0000)
Rename the SPMI device helper which is used to lookup a device from its
OF node as spmi_find_device_by_of_node() so that it reflects the
implementation and matches how other helpers like this are named.

This will specifically make it more clear that this is a lookup function
which returns a reference counted structure.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20231003152927.15000-6-johan+linaro@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/qcom-spmi-pmic.c
drivers/spmi/spmi.c
include/linux/spmi.h

index 203b1e27a1ae3e52611b39c82c62fb37fd32c729..4549fa9f7d4bcab2167b6f53a21c251ba7004507 100644 (file)
@@ -116,7 +116,7 @@ static struct spmi_device *qcom_pmic_get_base_usid(struct spmi_device *sdev, str
                }
 
                if (pmic_addr == function_parent_usid - (ctx->num_usids - 1)) {
-                       sdev = spmi_device_from_of(child);
+                       sdev = spmi_find_device_by_of_node(child);
                        if (!sdev) {
                                /*
                                 * If the base USID for this PMIC hasn't been
index ca2fd4d72fa6ad635903b920b89c8fafee76a8c4..93cd4a34debc7808c6a0cd336b47d38204db8f53 100644 (file)
@@ -388,7 +388,7 @@ static struct bus_type spmi_bus_type = {
 };
 
 /**
- * spmi_device_from_of() - get the associated SPMI device from a device node
+ * spmi_find_device_by_of_node() - look up an SPMI device from a device node
  *
  * @np:                device node
  *
@@ -397,7 +397,7 @@ static struct bus_type spmi_bus_type = {
  *
  * Returns the struct spmi_device associated with a device node or NULL.
  */
-struct spmi_device *spmi_device_from_of(struct device_node *np)
+struct spmi_device *spmi_find_device_by_of_node(struct device_node *np)
 {
        struct device *dev = bus_find_device_by_of_node(&spmi_bus_type, np);
 
@@ -405,7 +405,7 @@ struct spmi_device *spmi_device_from_of(struct device_node *np)
                return to_spmi_device(dev);
        return NULL;
 }
-EXPORT_SYMBOL_GPL(spmi_device_from_of);
+EXPORT_SYMBOL_GPL(spmi_find_device_by_of_node);
 
 /**
  * spmi_device_alloc() - Allocate a new SPMI device
index eac1956a8727e05a973c0cb5b2618b86f33f6c33..2a4ce4144f9f1b62ba2abb577d543f16028869d9 100644 (file)
@@ -166,7 +166,7 @@ static inline void spmi_driver_unregister(struct spmi_driver *sdrv)
 
 struct device_node;
 
-struct spmi_device *spmi_device_from_of(struct device_node *np);
+struct spmi_device *spmi_find_device_by_of_node(struct device_node *np);
 int spmi_register_read(struct spmi_device *sdev, u8 addr, u8 *buf);
 int spmi_ext_register_read(struct spmi_device *sdev, u8 addr, u8 *buf,
                           size_t len);