From: Eddie James <eajames@linux.ibm.com>
To: linux-fsi@lists.ozlabs.org
Cc: eajames@linux.ibm.com, linux-kernel@vger.kernel.org,
jk@ozlabs.org, joel@jms.id.au, alistair@popple.id.au
Subject: [PATCH v5 2/3] fsi: occ: Find next available child rather than node name match
Date: Tue, 14 May 2024 16:39:19 -0500 [thread overview]
Message-ID: <20240514213920.159357-3-eajames@linux.ibm.com> (raw)
In-Reply-To: <20240514213920.159357-1-eajames@linux.ibm.com>
There's no reason to restrict the creation of the hwmon device to
a matching child node name. Just get the first available one. There
should only be one child node anyway.
Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
drivers/fsi/fsi-occ.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fsi/fsi-occ.c b/drivers/fsi/fsi-occ.c
index 2023355b39805..9a3658d863792 100644
--- a/drivers/fsi/fsi-occ.c
+++ b/drivers/fsi/fsi-occ.c
@@ -669,7 +669,7 @@ static int occ_probe(struct platform_device *pdev)
return rc;
}
- hwmon_node = of_get_child_by_name(dev->of_node, hwmon_dev_info.name);
+ hwmon_node = of_get_next_available_child(dev->of_node, NULL);
if (hwmon_node) {
snprintf(child_name, sizeof(child_name), "%s.%d", hwmon_dev_info.name, occ->idx);
hwmon_dev = of_platform_device_create(hwmon_node, child_name, dev);
--
2.39.3
next prev parent reply other threads:[~2024-05-14 21:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-14 21:39 [PATCH v5 0/3] fsi: Update drivers with latest documentation Eddie James
2024-05-14 21:39 ` [PATCH v5 1/3] fsi: occ: Get device number from FSI minor number API Eddie James
2024-05-14 21:39 ` Eddie James [this message]
2024-05-14 21:39 ` [PATCH v5 3/3] fsi: scom: Update compatible string to match documentation Eddie James
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=20240514213920.159357-3-eajames@linux.ibm.com \
--to=eajames@linux.ibm.com \
--cc=alistair@popple.id.au \
--cc=jk@ozlabs.org \
--cc=joel@jms.id.au \
--cc=linux-fsi@lists.ozlabs.org \
--cc=linux-kernel@vger.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