Linux ATA/IDE development
 help / color / mirror / Atom feed
* [PATCH] ata: libahci_platform: use of_platform_device_create() return value
@ 2026-07-09  1:42 Rosen Penev
  2026-07-09  1:46 ` Damien Le Moal
  2026-07-09  1:50 ` sashiko-bot
  0 siblings, 2 replies; 6+ messages in thread
From: Rosen Penev @ 2026-07-09  1:42 UTC (permalink / raw)
  To: linux-ide; +Cc: Hans de Goede, Damien Le Moal, Niklas Cassel, open list

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-07-09  2:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09  1:42 [PATCH] ata: libahci_platform: use of_platform_device_create() return value Rosen Penev
2026-07-09  1:46 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox