projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3cc9e6
)
xen/arm: Check if the device is available before using it
author
Julien Grall
<julien.grall@linaro.org>
Fri, 13 Sep 2013 12:49:33 +0000
(13:49 +0100)
committer
Ian Campbell
<ian.campbell@citrix.com>
Tue, 17 Sep 2013 14:29:16 +0000
(15:29 +0100)
It's possible to have a device description in the DTS but the device is not
wired.
device_init must check if the device is available before doing anything with
it.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/device.c
patch
|
blob
|
history
diff --git
a/xen/arch/arm/device.c
b/xen/arch/arm/device.c
index dc751a979a8dba9656c7e7aef700668ed4787456..f86b2e3f331b5e28b81cb058dfa20c22217ba3d6 100644
(file)
--- a/
xen/arch/arm/device.c
+++ b/
xen/arch/arm/device.c
@@
-47,6
+47,9
@@
int __init device_init(struct dt_device_node *dev, enum device_type type,
ASSERT(dev != NULL);
+ if ( !dt_device_is_available(dev) )
+ return -ENODEV;
+
for ( desc = _sdevice; desc != _edevice; desc++ )
{
if ( desc->type != type )