From: Rosen Penev <rosenp@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Hans de Goede <hansg@kernel.org>,
Damien Le Moal <dlemoal@kernel.org>,
Niklas Cassel <cassel@kernel.org>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] ata: libahci_platform: use of_platform_device_create() return value
Date: Wed, 8 Jul 2026 18:42:30 -0700 [thread overview]
Message-ID: <20260709014230.1905756-1-rosenp@gmail.com> (raw)
of_platform_device_create() already returns the struct platform_device
pointer, so there is no need for a separate of_find_device_by_node()
call. Use the return value directly.
Avoids having to free the reference from of_find_device_by_node().
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/ata/libahci_platform.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
index 6e072d681341..2aa3df58fc9a 100644
--- a/drivers/ata/libahci_platform.c
+++ b/drivers/ata/libahci_platform.c
@@ -617,10 +617,7 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,
mask_port_map |= BIT(port);
#ifdef CONFIG_OF_ADDRESS
- of_platform_device_create(child, NULL, NULL);
-
- port_dev = of_find_device_by_node(child);
-
+ port_dev = of_platform_device_create(child, NULL, NULL);
if (port_dev) {
rc = ahci_platform_get_regulator(hpriv, port,
&port_dev->dev);
--
2.55.0
next reply other threads:[~2026-07-09 1:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 1:42 Rosen Penev [this message]
2026-07-09 1:46 ` [PATCH] ata: libahci_platform: use of_platform_device_create() return value Damien Le Moal
2026-07-09 1:50 ` sashiko-bot
2026-07-09 1:59 ` Rosen Penev
2026-07-09 2:00 ` Damien Le Moal
2026-07-09 2:01 ` Rosen Penev
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=20260709014230.1905756-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=hansg@kernel.org \
--cc=linux-ide@vger.kernel.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