diff mbox

[4/6] HSI: omap_ssi: fix removal of port platform device

Message ID 1461982153-19139-5-git-send-email-sre@kernel.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sebastian Reichel April 30, 2016, 2:09 a.m. UTC
This avoids removal of the HSI port device when
only the platform port device should be removed
and clears the POPULATED bit in the DT node, so
that a new platform device is created when the
driver is probed again.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/hsi/controllers/omap_ssi.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Pavel Machek May 1, 2016, 9:41 a.m. UTC | #1
On Sat 2016-04-30 04:09:11, Sebastian Reichel wrote:
> This avoids removal of the HSI port device when
> only the platform port device should be removed
> and clears the POPULATED bit in the DT node, so
> that a new platform device is created when the
> driver is probed again.
> 
> Signed-off-by: Sebastian Reichel <sre@kernel.org>

3,4: Acked-by: Pavel Machek <pavel@ucw.cz>
diff mbox

Patch

diff --git a/drivers/hsi/controllers/omap_ssi.c b/drivers/hsi/controllers/omap_ssi.c
index ffb921482e76..68dfdaa19938 100644
--- a/drivers/hsi/controllers/omap_ssi.c
+++ b/drivers/hsi/controllers/omap_ssi.c
@@ -451,6 +451,10 @@  static int ssi_remove_ports(struct device *dev, void *c)
 {
 	struct platform_device *pdev = to_platform_device(dev);
 
+	if (!dev->of_node)
+		return 0;
+
+	of_node_clear_flag(dev->of_node, OF_POPULATED);
 	of_device_unregister(pdev);
 
 	return 0;