Page MenuHomeFreeBSD

Fix registration of MPIC driver
ClosedPublic

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

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

loos edited edge metadata.May 16 2017, 2:57 AM

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.

loos accepted this revision.May 17 2017, 3:29 AM
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.