Skip to contentSkip to conversation

driver core: platform: Remove platform_device_add_properties()

PATCH Superseded Heikki Krogerus 4 participants 10 messages May 18, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover driver core: platform: Remove platform_device_add_properties()

Hi,

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(-)
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/2 ARM: tegra: paz00: Handle device properties with software node API

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

Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>
---
 arch/arm/mach-tegra/board-paz00.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-tegra/board-paz00.c +1 -1
index b5c990a7a5af5..18d37f90cdfe3 100644
@@ -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);
 }
Signature · 1 line
2.30.2
#2 lore raw

PATCH 2/2 driver core: platform: Remove platform_device_add_properties()

In reply to Heikki Krogerus

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.

---
 drivers/base/platform.c         | 20 ++------------------
 include/linux/platform_device.h |  2 --
 2 files changed, 2 insertions(+), 20 deletions(-)
drivers/base/platform.c +2 -18
index 9cd34def2237b..0299b03e64d40 100644
@@ -661,22 +661,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
@@ -862,8 +846,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;
 	}
include/linux/platform_device.h +0 -2
index cd81e060863c9..a05eb819f306a 100644
@@ -200,8 +200,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);
Signature · 1 line
2.30.2
Reviewed-by on the v1 series
#3 lore raw
In reply to Heikki Krogerus
Quoted 8 lines · Heikki Krogerus

Hi,

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.

Cool!

Btw, which base have you used for this series?

Quoted 16 lines

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(-)
Signature · 1 line
2.30.2
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#4 lore raw
Quoted 6 lines · Andy Shevchenko
Quoted 5 lines · Heikki Krogerus

Hi,

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

Quoted 8 lines
Quoted 3 lines

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.

Cool!

Btw, which base have you used for this series?

intel-next for this one.

Signature · 1 line
heikki
#5 lore raw
Quoted 11 lines · Heikki Krogerus
Quoted 10 lines · Andy Shevchenko
Quoted 8 lines · Heikki Krogerus

Hi,

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.

Quoted 6 lines
Quoted 4 lines

Cool!

Btw, which base have you used for this series?

intel-next for this one.

I mean linux-next :-)

Signature · 1 line
heikki
#6 lore raw
Quoted 12 lines · Heikki Krogerus
Quoted 11 lines · Heikki Krogerus
Quoted 10 lines · Andy Shevchenko
Quoted 8 lines · Heikki Krogerus

Hi,

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.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Cool!

Btw, which base have you used for this series?

intel-next for this one.

I mean linux-next :-)

Let's wait for CIs to respond. I have a feeling that the first patch is good for v5.14, while the second one is probably for the next cycle.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw
Quoted 16 lines · Andy Shevchenko
Quoted 15 lines · Heikki Krogerus
Quoted 14 lines · Heikki Krogerus
Quoted 13 lines · Andy Shevchenko
Quoted 8 lines · Heikki Krogerus

Hi,

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.

Cool!

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Btw, which base have you used for this series?

intel-next for this one.

I mean linux-next :-)

Let's wait for CIs to respond. I have a feeling that the first patch is good for v5.14, while the second one is probably for the next cycle.

Why? I can take both now, no problem...

#8 lore raw
Quoted 20 lines · Greg Kroah-Hartman
Quoted 18 lines · Andy Shevchenko
Quoted 17 lines · Heikki Krogerus
Quoted 16 lines · Heikki Krogerus
Quoted 14 lines · Andy Shevchenko
Quoted 8 lines · Heikki Krogerus

Hi,

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.

Cool!

Btw, which base have you used for this series?

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

intel-next for this one.

I mean linux-next :-)

Let's wait for CIs to respond. I have a feeling that the first patch is good for v5.14, while the second one is probably for the next cycle.

Why? I can take both now, no problem...

Not really, there are dependencies, one in my tree ATM.

It's better if I take them IMHO.

maintainer Acked-by
#9 lore raw
Quoted 26 lines · Rafael J. Wysocki
Quoted 24 lines · Greg Kroah-Hartman
Quoted 22 lines · Andy Shevchenko
Quoted 20 lines · Heikki Krogerus
Quoted 11 lines · Heikki Krogerus
Quoted 10 lines · Andy Shevchenko
Quoted 8 lines · Heikki Krogerus

Hi,

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.

Quoted 6 lines
Quoted 4 lines

Cool!

Btw, which base have you used for this series?

intel-next for this one.

I mean linux-next :-)

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Let's wait for CIs to respond. I have a feeling that the first patch is good for v5.14, while the second one is probably for the next cycle.

Why? I can take both now, no problem...

Not really, there are dependencies, one in my tree ATM.

It's better if I take them IMHO.

Sure, feel free to: