Linux ATA/IDE development
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Rosen Penev <rosenp@gmail.com>, linux-ide@vger.kernel.org
Cc: Hans de Goede <hansg@kernel.org>,
	Niklas Cassel <cassel@kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ata: libahci_platform: use of_platform_device_create() return value
Date: Thu, 9 Jul 2026 10:46:01 +0900	[thread overview]
Message-ID: <261cd548-8e48-483f-8469-9155988b284d@kernel.org> (raw)
In-Reply-To: <20260709014230.1905756-1-rosenp@gmail.com>

On 7/9/26 10:42, Rosen Penev wrote:
> 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().

Looks OK to me, but how is the above comment relevant? I do not see any change
that can be described with this sentence. Maybe remove it? (I can do it when
applying)

> 
> 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);


-- 
Damien Le Moal
Western Digital Research

  reply	other threads:[~2026-07-09  1:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=261cd548-8e48-483f-8469-9155988b284d@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=cassel@kernel.org \
    --cc=hansg@kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rosenp@gmail.com \
    /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