[rtems commit] leon, grcan: unregister interrupt handler at close

Daniel Hellstrom danielh at rtems.org
Sun May 14 10:34:28 UTC 2017


Module:    rtems
Branch:    master
Commit:    5d367c56cfe730b94c0489447c05f3c9ff6693c9
Changeset: http://git.rtems.org/rtems/commit/?id=5d367c56cfe730b94c0489447c05f3c9ff6693c9

Author:    Martin Aberg <maberg at gaisler.com>
Date:      Thu Jan 26 10:54:57 2017 +0100

leon, grcan: unregister interrupt handler at close

---

 c/src/lib/libbsp/sparc/shared/can/grcan.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/c/src/lib/libbsp/sparc/shared/can/grcan.c b/c/src/lib/libbsp/sparc/shared/can/grcan.c
index 003cecf..c7aadae 100644
--- a/c/src/lib/libbsp/sparc/shared/can/grcan.c
+++ b/c/src/lib/libbsp/sparc/shared/can/grcan.c
@@ -1275,8 +1275,12 @@ int grcan_close(void *d)
 
 	FUNCDBG();
 
-	if ( pDev->started )
+	if ( pDev->started ) {
+		/* Disable interrupts */
+		drvmgr_interrupt_unregister(pDev->dev, 0, grcan_interrupt, pDev);
 		grcan_hw_stop(pDev);
+		pDev->started = 0;
+	}
 
 	grcan_hw_reset(pDev->regs);
 




More information about the vc mailing list