linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] spi: Remove support for dangling device properties
Date: Wed,  3 Mar 2021 18:28:14 +0300	[thread overview]
Message-ID: <20210303152814.35070-5-heikki.krogerus@linux.intel.com> (raw)
In-Reply-To: <20210303152814.35070-1-heikki.krogerus@linux.intel.com>

From now on only accepting complete software nodes.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
 drivers/spi/spi.c       | 24 +++---------------------
 include/linux/spi/spi.h |  4 ----
 2 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 9b46998ae2a44..016bbfbce90b7 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);
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index f47f94ea6fa99..7cb3194d5ba59 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -19,7 +19,6 @@
 #include <uapi/linux/spi/spi.h>
 
 struct dma_chan;
-struct property_entry;
 struct software_node;
 struct spi_controller;
 struct spi_transfer;
@@ -1410,7 +1409,6 @@ static inline ssize_t spi_w8r16be(struct spi_device *spi, u8 cmd)
  * @modalias: Initializes spi_device.modalias; identifies the driver.
  * @platform_data: Initializes spi_device.platform_data; the particular
  *	data stored there is driver-specific.
- * @properties: Deprecated - use software node instead.
  * @swnode: Software node for the device.
  * @controller_data: Initializes spi_device.controller_data; some
  *	controllers need hints about hardware setup, e.g. for DMA.
@@ -1444,12 +1442,10 @@ struct spi_board_info {
 	 *
 	 * platform_data goes to spi_device.dev.platform_data,
 	 * controller_data goes to spi_device.controller_data,
-	 * device properties are copied and attached to spi_device,
 	 * irq is copied too
 	 */
 	char		modalias[SPI_NAME_SIZE];
 	const void	*platform_data;
-	const struct property_entry *properties;
 	const struct software_node *swnode;
 	void		*controller_data;
 	int		irq;
-- 
2.30.1


  parent reply	other threads:[~2021-03-04  0:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03 15:28 [PATCH 0/4] spi: Adding support for software nodes Heikki Krogerus
2021-03-03 15:28 ` [PATCH 1/4] spi: Add " Heikki Krogerus
2021-03-03 15:28 ` [PATCH 2/4] ARM: pxa: icontrol: Constify the software node Heikki Krogerus
2021-03-03 15:28 ` [PATCH 3/4] ARM: pxa: zeus: " Heikki Krogerus
2021-03-03 15:28 ` Heikki Krogerus [this message]
2021-03-12 20:47 ` [PATCH 0/4] spi: Adding support for software nodes Mark Brown
2021-03-16 17:59 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210303152814.35070-5-heikki.krogerus@linux.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).