LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH RESEND 0/2] driver core: platform: Remove platform_device_add_properties()
@ 2021-08-17 10:24 Heikki Krogerus
  2021-08-17 10:24 ` [PATCH RESEND 1/2] ARM: tegra: paz00: Handle device properties with software node API Heikki Krogerus
  2021-08-17 10:24 ` [PATCH RESEND 2/2] driver core: platform: Remove platform_device_add_properties() Heikki Krogerus
  0 siblings, 2 replies; 6+ messages in thread
From: Heikki Krogerus @ 2021-08-17 10:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Andy Shevchenko, Thierry Reding, Jonathan Hunter,
	Rafael J. Wysocki, linux-kernel

Hi,

It seems Rafael never took these. Let's try again.

The original cover letter:

It looks like there is only one place left that still uses the
function. Converting that last user and removing the thing.

Note, I'm actually resending the patch for board-paz00.c. I'm assuming
the original patch slipped through the cracks because it did not end
up anywhere.

I would imagine that it's OK to everybody if Greg takes these?

thanks,


Heikki Krogerus (2):
  ARM: tegra: paz00: Handle device properties with software node API
  driver core: platform: Remove platform_device_add_properties()

 arch/arm/mach-tegra/board-paz00.c |  2 +-
 drivers/base/platform.c           | 20 ++------------------
 include/linux/platform_device.h   |  2 --
 3 files changed, 3 insertions(+), 21 deletions(-)

-- 
2.30.2


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

* [PATCH RESEND 1/2] ARM: tegra: paz00: Handle device properties with software node API
  2021-08-17 10:24 [PATCH RESEND 0/2] driver core: platform: Remove platform_device_add_properties() Heikki Krogerus
@ 2021-08-17 10:24 ` Heikki Krogerus
  2021-08-17 14:30   ` Thierry Reding
  2021-08-17 10:24 ` [PATCH RESEND 2/2] driver core: platform: Remove platform_device_add_properties() Heikki Krogerus
  1 sibling, 1 reply; 6+ messages in thread
From: Heikki Krogerus @ 2021-08-17 10:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Andy Shevchenko, Thierry Reding, Jonathan Hunter,
	Rafael J. Wysocki, linux-kernel

The old device property API is going to be removed.
Replacing the device_add_properties() call with the software
node API equivalent, device_create_managed_software_node().

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 arch/arm/mach-tegra/board-paz00.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c
index b5c990a7a5af5..18d37f90cdfe3 100644
--- a/arch/arm/mach-tegra/board-paz00.c
+++ b/arch/arm/mach-tegra/board-paz00.c
@@ -36,7 +36,7 @@ static struct gpiod_lookup_table wifi_gpio_lookup = {
 
 void __init tegra_paz00_wifikill_init(void)
 {
-	platform_device_add_properties(&wifi_rfkill_device, wifi_rfkill_prop);
+	device_create_managed_software_node(&wifi_rfkill_device.dev, wifi_rfkill_prop, NULL);
 	gpiod_add_lookup_table(&wifi_gpio_lookup);
 	platform_device_register(&wifi_rfkill_device);
 }
-- 
2.30.2


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

* [PATCH RESEND 2/2] driver core: platform: Remove platform_device_add_properties()
  2021-08-17 10:24 [PATCH RESEND 0/2] driver core: platform: Remove platform_device_add_properties() Heikki Krogerus
  2021-08-17 10:24 ` [PATCH RESEND 1/2] ARM: tegra: paz00: Handle device properties with software node API Heikki Krogerus
@ 2021-08-17 10:24 ` Heikki Krogerus
  2021-08-17 14:32   ` Thierry Reding
  1 sibling, 1 reply; 6+ messages in thread
From: Heikki Krogerus @ 2021-08-17 10:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Andy Shevchenko, Thierry Reding, Jonathan Hunter,
	Rafael J. Wysocki, linux-kernel

There are no more users for it. The last place where it's
called is in platform_device_register_full(). Replacing that
call with device_create_managed_software_node() and
removing the function.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/base/platform.c         | 20 ++------------------
 include/linux/platform_device.h |  2 --
 2 files changed, 2 insertions(+), 20 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index a94b7f4548814..652531f67135a 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -641,22 +641,6 @@ int platform_device_add_data(struct platform_device *pdev, const void *data,
 }
 EXPORT_SYMBOL_GPL(platform_device_add_data);
 
-/**
- * platform_device_add_properties - add built-in properties to a platform device
- * @pdev: platform device to add properties to
- * @properties: null terminated array of properties to add
- *
- * The function will take deep copy of @properties and attach the copy to the
- * platform device. The memory associated with properties will be freed when the
- * platform device is released.
- */
-int platform_device_add_properties(struct platform_device *pdev,
-				   const struct property_entry *properties)
-{
-	return device_add_properties(&pdev->dev, properties);
-}
-EXPORT_SYMBOL_GPL(platform_device_add_properties);
-
 /**
  * platform_device_add - add a platform device to device hierarchy
  * @pdev: platform device we're adding
@@ -842,8 +826,8 @@ struct platform_device *platform_device_register_full(
 		goto err;
 
 	if (pdevinfo->properties) {
-		ret = platform_device_add_properties(pdev,
-						     pdevinfo->properties);
+		ret = device_create_managed_software_node(&pdev->dev,
+							  pdevinfo->properties, NULL);
 		if (ret)
 			goto err;
 	}
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index ed42ea9f60ba0..7c96f169d2740 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -197,8 +197,6 @@ extern int platform_device_add_resources(struct platform_device *pdev,
 					 unsigned int num);
 extern int platform_device_add_data(struct platform_device *pdev,
 				    const void *data, size_t size);
-extern int platform_device_add_properties(struct platform_device *pdev,
-				const struct property_entry *properties);
 extern int platform_device_add(struct platform_device *pdev);
 extern void platform_device_del(struct platform_device *pdev);
 extern void platform_device_put(struct platform_device *pdev);
-- 
2.30.2


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

* Re: [PATCH RESEND 1/2] ARM: tegra: paz00: Handle device properties with software node API
  2021-08-17 10:24 ` [PATCH RESEND 1/2] ARM: tegra: paz00: Handle device properties with software node API Heikki Krogerus
@ 2021-08-17 14:30   ` Thierry Reding
  2021-08-18 10:57     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 6+ messages in thread
From: Thierry Reding @ 2021-08-17 14:30 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: Greg Kroah-Hartman, Andy Shevchenko, Jonathan Hunter,
	Rafael J. Wysocki, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1490 bytes --]

On Tue, Aug 17, 2021 at 01:24:48PM +0300, Heikki Krogerus wrote:
> The old device property API is going to be removed.
> Replacing the device_add_properties() call with the software
> node API equivalent, device_create_managed_software_node().
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>  arch/arm/mach-tegra/board-paz00.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c
> index b5c990a7a5af5..18d37f90cdfe3 100644
> --- a/arch/arm/mach-tegra/board-paz00.c
> +++ b/arch/arm/mach-tegra/board-paz00.c
> @@ -36,7 +36,7 @@ static struct gpiod_lookup_table wifi_gpio_lookup = {
>  
>  void __init tegra_paz00_wifikill_init(void)
>  {
> -	platform_device_add_properties(&wifi_rfkill_device, wifi_rfkill_prop);
> +	device_create_managed_software_node(&wifi_rfkill_device.dev, wifi_rfkill_prop, NULL);
>  	gpiod_add_lookup_table(&wifi_gpio_lookup);
>  	platform_device_register(&wifi_rfkill_device);
>  }

Seems alright. Looks to be doing mostly the same thing as the original
platform_device_add_properties() was doing, except for the node now
being managed, which is irrelevant in this context.

I'm fine with Greg picking this up. I'm not aware of any other changes
to this file that might cause a conflict for v5.15.

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH RESEND 2/2] driver core: platform: Remove platform_device_add_properties()
  2021-08-17 10:24 ` [PATCH RESEND 2/2] driver core: platform: Remove platform_device_add_properties() Heikki Krogerus
@ 2021-08-17 14:32   ` Thierry Reding
  0 siblings, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2021-08-17 14:32 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: Greg Kroah-Hartman, Andy Shevchenko, Jonathan Hunter,
	Rafael J. Wysocki, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 685 bytes --]

On Tue, Aug 17, 2021 at 01:24:49PM +0300, Heikki Krogerus wrote:
> There are no more users for it. The last place where it's
> called is in platform_device_register_full(). Replacing that
> call with device_create_managed_software_node() and
> removing the function.
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
>  drivers/base/platform.c         | 20 ++------------------
>  include/linux/platform_device.h |  2 --
>  2 files changed, 2 insertions(+), 20 deletions(-)

Indeed, no other users, and looks correct, too =):

Reviewed-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH RESEND 1/2] ARM: tegra: paz00: Handle device properties with software node API
  2021-08-17 14:30   ` Thierry Reding
@ 2021-08-18 10:57     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-18 10:57 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Heikki Krogerus, Andy Shevchenko, Jonathan Hunter,
	Rafael J. Wysocki, linux-kernel

On Tue, Aug 17, 2021 at 04:30:44PM +0200, Thierry Reding wrote:
> On Tue, Aug 17, 2021 at 01:24:48PM +0300, Heikki Krogerus wrote:
> > The old device property API is going to be removed.
> > Replacing the device_add_properties() call with the software
> > node API equivalent, device_create_managed_software_node().
> > 
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> > ---
> >  arch/arm/mach-tegra/board-paz00.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/arm/mach-tegra/board-paz00.c b/arch/arm/mach-tegra/board-paz00.c
> > index b5c990a7a5af5..18d37f90cdfe3 100644
> > --- a/arch/arm/mach-tegra/board-paz00.c
> > +++ b/arch/arm/mach-tegra/board-paz00.c
> > @@ -36,7 +36,7 @@ static struct gpiod_lookup_table wifi_gpio_lookup = {
> >  
> >  void __init tegra_paz00_wifikill_init(void)
> >  {
> > -	platform_device_add_properties(&wifi_rfkill_device, wifi_rfkill_prop);
> > +	device_create_managed_software_node(&wifi_rfkill_device.dev, wifi_rfkill_prop, NULL);
> >  	gpiod_add_lookup_table(&wifi_gpio_lookup);
> >  	platform_device_register(&wifi_rfkill_device);
> >  }
> 
> Seems alright. Looks to be doing mostly the same thing as the original
> platform_device_add_properties() was doing, except for the node now
> being managed, which is irrelevant in this context.
> 
> I'm fine with Greg picking this up. I'm not aware of any other changes
> to this file that might cause a conflict for v5.15.
> 
> Acked-by: Thierry Reding <treding@nvidia.com>

I'll pick it up, thanks!

greg k-h

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

end of thread, other threads:[~2021-08-18 10:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 10:24 [PATCH RESEND 0/2] driver core: platform: Remove platform_device_add_properties() Heikki Krogerus
2021-08-17 10:24 ` [PATCH RESEND 1/2] ARM: tegra: paz00: Handle device properties with software node API Heikki Krogerus
2021-08-17 14:30   ` Thierry Reding
2021-08-18 10:57     ` Greg Kroah-Hartman
2021-08-17 10:24 ` [PATCH RESEND 2/2] driver core: platform: Remove platform_device_add_properties() Heikki Krogerus
2021-08-17 14:32   ` Thierry Reding

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