From: Rob Herring <robh@kernel.org>
To: Kunwu Chan <kunwu.chan@linux.dev>
Cc: saravanak@google.com, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, Kunwu Chan <chentao@kylinos.cn>
Subject: Re: [PATCH] of/platform: Use dev_is_platform() to identify PCI devices
Date: Wed, 28 Aug 2024 10:08:26 -0500 [thread overview]
Message-ID: <20240828150826.GA3803566-robh@kernel.org> (raw)
In-Reply-To: <20240827094403.166238-1-kunwu.chan@linux.dev>
On Tue, Aug 27, 2024 at 05:44:02PM +0800, Kunwu Chan wrote:
> From: Kunwu Chan <chentao@kylinos.cn>
Subject - For PCI devices?
>
> Use dev_is_platform() instead of checking bus type directly.
>
> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
> ---
> drivers/of/platform.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index 86be4dfb9323..3696140bae9e 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -625,7 +625,7 @@ int of_platform_device_destroy(struct device *dev, void *data)
> of_node_clear_flag(dev->of_node, OF_POPULATED);
> of_node_clear_flag(dev->of_node, OF_POPULATED_BUS);
>
> - if (dev->bus == &platform_bus_type)
> + if (dev_is_platform(dev))
> platform_device_unregister(to_platform_device(dev));
> #ifdef CONFIG_ARM_AMBA
> else if (dev->bus == &amba_bustype)
Perhaps to keep things consistent, add a dev_is_amba() and use it here.
> --
> 2.41.0
>
next prev parent reply other threads:[~2024-08-28 15:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 9:44 [PATCH] of/platform: Use dev_is_platform() to identify PCI devices Kunwu Chan
2024-08-28 15:08 ` Rob Herring [this message]
2024-08-29 1:37 ` Kunwu Chan
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=20240828150826.GA3803566-robh@kernel.org \
--to=robh@kernel.org \
--cc=chentao@kylinos.cn \
--cc=devicetree@vger.kernel.org \
--cc=kunwu.chan@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=saravanak@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.