linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan+linaro@kernel.org>
To: Lee Jones <lee@kernel.org>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Stephen Boyd <sboyd@kernel.org>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Johan Hovold <johan+linaro@kernel.org>
Subject: [PATCH 5/5] spmi: rename spmi device lookup helper
Date: Tue,  3 Oct 2023 17:29:27 +0200	[thread overview]
Message-ID: <20231003152927.15000-6-johan+linaro@kernel.org> (raw)
In-Reply-To: <20231003152927.15000-1-johan+linaro@kernel.org>

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>
---
 drivers/mfd/qcom-spmi-pmic.c | 2 +-
 drivers/spmi/spmi.c          | 6 +++---
 include/linux/spmi.h         | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/qcom-spmi-pmic.c b/drivers/mfd/qcom-spmi-pmic.c
index ee55f09da3ba..1c17adeb7a6d 100644
--- a/drivers/mfd/qcom-spmi-pmic.c
+++ b/drivers/mfd/qcom-spmi-pmic.c
@@ -114,7 +114,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
diff --git a/drivers/spmi/spmi.c b/drivers/spmi/spmi.c
index ca2fd4d72fa6..93cd4a34debc 100644
--- a/drivers/spmi/spmi.c
+++ b/drivers/spmi/spmi.c
@@ -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
diff --git a/include/linux/spmi.h b/include/linux/spmi.h
index eac1956a8727..2a4ce4144f9f 100644
--- a/include/linux/spmi.h
+++ b/include/linux/spmi.h
@@ -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);
-- 
2.41.0


  parent reply	other threads:[~2023-10-03 15:29 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-03 15:29 [PATCH 0/5] mfd: qcom-spmi-pmic: fix revid implementation Johan Hovold
2023-10-03 15:29 ` [PATCH 1/5] mfd: qcom-spmi-pmic: fix reference leaks in revid helper Johan Hovold
2023-10-03 15:29 ` [PATCH 2/5] mfd: qcom-spmi-pmic: fix revid implementation Johan Hovold
2023-10-03 15:29 ` [PATCH 3/5] mfd: qcom-spmi-pmic: switch to EXPORT_SYMBOL_GPL() Johan Hovold
2023-10-06 23:53   ` Konrad Dybcio
2023-10-03 15:29 ` [PATCH 4/5] spmi: document spmi_device_from_of() refcounting Johan Hovold
2023-10-24  1:58   ` Stephen Boyd
2023-10-25 12:17   ` (subset) " Lee Jones
2023-10-03 15:29 ` Johan Hovold [this message]
2023-10-24  1:58   ` [PATCH 5/5] spmi: rename spmi device lookup helper Stephen Boyd
2023-10-25 12:17   ` (subset) " Lee Jones
2023-10-03 15:57 ` [PATCH 0/5] mfd: qcom-spmi-pmic: fix revid implementation Caleb Connolly
2023-10-12 10:20 ` (subset) " Lee Jones
2023-10-13  9:55   ` Johan Hovold
2023-10-13 10:15     ` Lee Jones
2023-10-23  7:05     ` Need SPMI ack (was: Re: (subset) [PATCH 0/5] mfd: qcom-spmi-pmic: fix revid implementation) Johan Hovold
2023-10-25 12:17 ` (subset) [PATCH 0/5] mfd: qcom-spmi-pmic: fix revid implementation Lee Jones
2023-10-25 12:18   ` Lee Jones
2023-10-25 12:24     ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231003152927.15000-6-johan+linaro@kernel.org \
    --to=johan+linaro@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=caleb.connolly@linaro.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).