Return real error value instead of hard-coded ENXIO (fix after r300149)

It is possible to return real error value in case of gic_v3_attach()
failure instead of hard-coded ENXIO.

Obtained from:	Semihalf
Sponsored by:	Cavium
This commit is contained in:
Zbigniew Bodek 2016-06-01 08:20:10 +00:00
parent 5218e61a60
commit 32fb8300d4

View File

@ -141,11 +141,13 @@ gic_v3_fdt_attach(device_t dev)
xref = OF_xref_from_node(ofw_bus_get_node(dev));
if (intr_pic_register(dev, xref) == NULL) {
device_printf(dev, "could not register PIC\n");
err = ENXIO;
goto error;
}
if (intr_pic_claim_root(dev, xref, arm_gic_v3_intr, sc,
GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) {
err = ENXIO;
goto error;
}
#endif
@ -172,7 +174,7 @@ gic_v3_fdt_attach(device_t dev)
/* Failure so free resources */
gic_v3_detach(dev);
return (ENXIO);
return (err);
}
/* OFW bus interface */