mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
xen/arm: Check if the device is available before using it
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>
This commit is contained in:
1 parent
c3cc9e6c4b
commit
735d865183
1 file changed
+3
@@ -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 )
|
||||
|
||||