Skip to content

Commit 272f99e

Browse files
jhovoldlag-linaro
authored andcommitted
spmi: rename spmi device lookup helper
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 <[email protected]> Acked-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent ade7941 commit 272f99e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

drivers/mfd/qcom-spmi-pmic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static struct spmi_device *qcom_pmic_get_base_usid(struct spmi_device *sdev, str
116116
}
117117

118118
if (pmic_addr == function_parent_usid - (ctx->num_usids - 1)) {
119-
sdev = spmi_device_from_of(child);
119+
sdev = spmi_find_device_by_of_node(child);
120120
if (!sdev) {
121121
/*
122122
* If the base USID for this PMIC hasn't been

drivers/spmi/spmi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ static struct bus_type spmi_bus_type = {
388388
};
389389

390390
/**
391-
* spmi_device_from_of() - get the associated SPMI device from a device node
391+
* spmi_find_device_by_of_node() - look up an SPMI device from a device node
392392
*
393393
* @np: device node
394394
*
@@ -397,15 +397,15 @@ static struct bus_type spmi_bus_type = {
397397
*
398398
* Returns the struct spmi_device associated with a device node or NULL.
399399
*/
400-
struct spmi_device *spmi_device_from_of(struct device_node *np)
400+
struct spmi_device *spmi_find_device_by_of_node(struct device_node *np)
401401
{
402402
struct device *dev = bus_find_device_by_of_node(&spmi_bus_type, np);
403403

404404
if (dev)
405405
return to_spmi_device(dev);
406406
return NULL;
407407
}
408-
EXPORT_SYMBOL_GPL(spmi_device_from_of);
408+
EXPORT_SYMBOL_GPL(spmi_find_device_by_of_node);
409409

410410
/**
411411
* spmi_device_alloc() - Allocate a new SPMI device

include/linux/spmi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static inline void spmi_driver_unregister(struct spmi_driver *sdrv)
166166

167167
struct device_node;
168168

169-
struct spmi_device *spmi_device_from_of(struct device_node *np);
169+
struct spmi_device *spmi_find_device_by_of_node(struct device_node *np);
170170
int spmi_register_read(struct spmi_device *sdev, u8 addr, u8 *buf);
171171
int spmi_ext_register_read(struct spmi_device *sdev, u8 addr, u8 *buf,
172172
size_t len);

0 commit comments

Comments
 (0)