Skip to content

Commit

Permalink
driver core: platform: Remove platform_device_add_properties()
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20210817102449.39994-3-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Heikki Krogerus authored and Greg Kroah-Hartman committed Aug 18, 2021
1 parent 6d6e03d commit bd1e336
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
20 changes: 2 additions & 18 deletions drivers/base/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 0 additions & 2 deletions include/linux/platform_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bd1e336

Please sign in to comment.