Page MenuHomeFreeBSD

Fix registration of MPIC driver

Authored by on May 14 2017, 12:52 AM.

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

I think you can simplify this fix if you move the OF_device_register_xref() to happen before the if(). This way the if() don't need to be changed:

Index: arm/mv/mpic.c
--- arm/mv/mpic.c       (revision 318000)
+++ arm/mv/mpic.c       (working copy)
@@ -273,6 +273,7 @@
                bus_release_resources(dev, mv_mpic_spec, sc->mpic_res);
                return (ENXIO);
+       OF_device_register_xref(OF_xref_from_node(ofw_bus_get_node(dev)), dev);
        if (intr_pic_register(dev, OF_xref_from_device(dev)) == NULL) {
                device_printf(dev, "could not register PIC\n");
                bus_release_resources(dev, mv_mpic_spec, sc->mpic_res);

Thanks for the suggestion. It works, so I'll the patch in a moment.

This revision is now accepted and ready to land.May 17 2017, 3:29 AM
This revision was automatically updated to reflect the committed changes.