summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2016-09-03 09:14:58 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2016-09-20 14:21:07 +0100
commiteac8dbf74f30479b70b9a53f3b24285bd6229d09 (patch)
tree899cfadfdea3ffaada5dc48f4031d98e26784743
parent3be7988674ab33565700a37b210f502563d932e6 (diff)
ARM: sa1111: ensure we only touch RAB bus type devices when removing
When removing a SA1111 device, we try to remove all child devices. However, we must only remove our own RAB bus typed devices from the tree, there may be other devices present which should not be touched. This is necessary before we introduce gpiochip to SA1111 to avoid incorrectly trying to remove the gpiochip device, leading to an oops in __release_resource(). Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--arch/arm/common/sa1111.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 2e076c492005..303c62861d84 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -815,6 +815,8 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
static int sa1111_remove_one(struct device *dev, void *data)
{
struct sa1111_dev *sadev = SA1111_DEV(dev);
+ if (dev->bus != &sa1111_bus_type)
+ return 0;
device_del(&sadev->dev);
release_resource(&sadev->res);
put_device(&sadev->dev);