summaryrefslogtreecommitdiff
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>2021-03-03 18:28:14 +0300
committerMark Brown <broonie@kernel.org>2021-03-16 13:29:44 +0000
commitdf41a5dad586c8ead1bb7082b4b6fcb563e02199 (patch)
tree00128e840e521b3a040cddce0f7a8ba63b32c6a1 /drivers/spi/spi.c
parentd4272a7adf26c62c5afe86b6829712de519b4a26 (diff)
spi: Remove support for dangling device properties
>From now on only accepting complete software nodes. Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Link: https://lore.kernel.org/r/20210303152814.35070-5-heikki.krogerus@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r--drivers/spi/spi.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 9b46998ae2a4..016bbfbce90b 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -676,34 +676,23 @@ struct spi_device *spi_new_device(struct spi_controller *ctlr,
proxy->controller_data = chip->controller_data;
proxy->controller_state = NULL;
- if (chip->properties) {
- status = device_add_properties(&proxy->dev, chip->properties);
- if (status) {
- dev_err(&ctlr->dev,
- "failed to add properties to '%s': %d\n",
- chip->modalias, status);
- goto err_dev_put;
- }
- }
-
if (chip->swnode) {
status = device_add_software_node(&proxy->dev, chip->swnode);
if (status) {
dev_err(&ctlr->dev, "failed to add softwade node to '%s': %d\n",
chip->modalias, status);
- goto err_remove_props;
+ goto err_dev_put;
}
}
status = spi_add_device(proxy);
if (status < 0)
- goto err_remove_props;
+ goto err_dev_put;
return proxy;
-err_remove_props:
- device_remove_software_node(&proxy->dev);
err_dev_put:
+ device_remove_software_node(&proxy->dev);
spi_dev_put(proxy);
return NULL;
}
@@ -764,7 +753,6 @@ static void spi_match_controller_to_boardinfo(struct spi_controller *ctlr,
*
* The board info passed can safely be __initdata ... but be careful of
* any embedded pointers (platform_data, etc), they're copied as-is.
- * Device properties are deep-copied though.
*
* Return: zero on success, else a negative error code.
*/
@@ -784,12 +772,6 @@ int spi_register_board_info(struct spi_board_info const *info, unsigned n)
struct spi_controller *ctlr;
memcpy(&bi->board_info, info, sizeof(*info));
- if (info->properties) {
- bi->board_info.properties =
- property_entries_dup(info->properties);
- if (IS_ERR(bi->board_info.properties))
- return PTR_ERR(bi->board_info.properties);
- }
mutex_lock(&board_lock);
list_add_tail(&bi->list, &board_list);