# HG changeset patch
# User Gavin Lambert <gavinl@compacsort.com>
# Date 1429018455 14400
# Node ID f2bc4000e47ad25109e562bc14f957e30f36903d
# Parent  3affe9cd0b66fe55ef8e8060778ef9461a8204a0
When detaching a slave from a slave_config, fail any pending register requests instead of leaving them BUSY forever.

diff -r 3affe9cd0b66 -r f2bc4000e47a master/slave_config.c
--- a/master/slave_config.c	Tue Apr 14 09:33:24 2015 -0400
+++ b/master/slave_config.c	Tue Apr 14 09:34:15 2015 -0400
@@ -308,6 +308,10 @@
         list_for_each_entry(reg, &sc->reg_requests, list) {
             if (sc->slave->fsm.reg_request == reg) {
                 sc->slave->fsm.reg_request = NULL;
+                EC_SLAVE_WARN(sc->slave, "Aborting register request,"
+                        " slave is detaching.\n");
+                reg->state = EC_INT_REQUEST_FAILURE;
+                wake_up_all(&sc->slave->master->request_queue);
                 break;
             }
         }