* [PATCH] of/platform: Use dev_is_platform() to identify PCI devices
@ 2024-08-27 9:44 Kunwu Chan
2024-08-28 15:08 ` Rob Herring
0 siblings, 1 reply; 3+ messages in thread
From: Kunwu Chan @ 2024-08-27 9:44 UTC (permalink / raw)
To: robh, saravanak; +Cc: devicetree, linux-kernel, Kunwu Chan
From: Kunwu Chan <chentao@kylinos.cn>
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)
--
2.41.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] of/platform: Use dev_is_platform() to identify PCI devices
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
2024-08-29 1:37 ` Kunwu Chan
0 siblings, 1 reply; 3+ messages in thread
From: Rob Herring @ 2024-08-28 15:08 UTC (permalink / raw)
To: Kunwu Chan; +Cc: saravanak, devicetree, linux-kernel, Kunwu Chan
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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] of/platform: Use dev_is_platform() to identify PCI devices
2024-08-28 15:08 ` Rob Herring
@ 2024-08-29 1:37 ` Kunwu Chan
0 siblings, 0 replies; 3+ messages in thread
From: Kunwu Chan @ 2024-08-29 1:37 UTC (permalink / raw)
To: Rob Herring; +Cc: saravanak, devicetree, linux-kernel, Kunwu Chan
Thanks for the reply.
On 2024/8/28 23:08, Rob Herring wrote:
> On Tue, Aug 27, 2024 at 05:44:02PM +0800, Kunwu Chan wrote:
>> From: Kunwu Chan <chentao@kylinos.cn>
> Subject - For PCI devices?
My bad, i'll change it in v2.
>> 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.
>
Sure, i'am doing this in [1], i'll send the v2 patch after change it in
AMBA.
[1] https://lore.kernel.org/all/ZsiTPjtnZZIW-K4k@smile.fi.intel.com/
>> --
>> 2.41.0
>>
--
Thanks,
Kunwu.Chan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-29 1:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-08-29 1:37 ` Kunwu Chan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).