summaryrefslogtreecommitdiffstats
path: root/drivers/amba/bus.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-10-26 19:10:29 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-10-27 16:45:51 +0100
commit51b0e90ec6f978bcc5ebe970acd0c62cbb341575 (patch)
treee426c33eed57969f16f6ae26790e82361ae0abc6 /drivers/amba/bus.c
parent1678dcf7ca52b8028e6dd311fba1402eb49d3565 (diff)
downloadbarebox-51b0e90ec6f978bcc5ebe970acd0c62cbb341575.tar.gz
amba: check if on remove callback
Currently we get a null pointer dereference when booting linux on RPi which use "uart-pl011" driver. This driver doesn't implement a remove driver callback. This patch adds a check before calling the remove callback if the driver which use the amba bus implement such functionality. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/amba/bus.c')
-rw-r--r--drivers/amba/bus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index b934e11..ddd9661 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -70,7 +70,8 @@ static void amba_remove(struct device_d *dev)
struct amba_device *pcdev = to_amba_device(dev);
struct amba_driver *drv = to_amba_driver(dev->driver);
- drv->remove(pcdev);
+ if (drv->remove)
+ drv->remove(pcdev);
}
struct bus_type amba_bustype = {