diff --git a/src/emu/bay.c b/src/emu/bay.c index 37a5c62..26348f5 100644 --- a/src/emu/bay.c +++ b/src/emu/bay.c @@ -81,28 +81,6 @@ bay_register(struct bay *bay, struct chan *chan) return 0; } -int -bay_remove(struct bay *bay, struct chan *chan) -{ - struct bay_chan *bchan = find_bay_chan(bay, chan->name); - if (bchan == NULL) { - err("channel %s not registered", chan->name); - return -1; - } - - if (bchan->is_dirty) { - err("cannot remote bay channel %s in dirty state", chan->name); - return -1; - } - - chan_set_dirty_cb(chan, NULL, NULL); - - HASH_DEL(bay->channels, bchan); - free(bchan); - - return 0; -} - struct bay_cb * bay_add_cb(struct bay *bay, enum bay_cb_type type, struct chan *chan, bay_cb_func_t func, void *arg, int enabled) diff --git a/test/unit/bay.c b/test/unit/bay.c index 9dd6755..2e2f528 100644 --- a/test/unit/bay.c +++ b/test/unit/bay.c @@ -4,25 +4,6 @@ #include "emu/bay.h" #include "common.h" -static void -test_remove(struct bay *bay) -{ - struct chan chan; - chan_init(&chan, CHAN_SINGLE, "removeme"); - - if (bay_register(bay, &chan) != 0) - die("bay_register failed\n"); - - if (bay_find(bay, chan.name) == NULL) - die("bay_find failed\n"); - - if (bay_remove(bay, &chan) != 0) - die("bay_remove failed\n"); - - if (bay_find(bay, chan.name) != NULL) - die("bay_find didn't fail\n"); -} - static void test_duplicate(struct bay *bay) { @@ -34,9 +15,6 @@ test_duplicate(struct bay *bay) if (bay_register(bay, &chan) == 0) die("bay_register didn't fail\n"); - - if (bay_remove(bay, &chan) != 0) - die("bay_remove failed\n"); } static int @@ -83,9 +61,6 @@ test_callback(struct bay *bay) if (data != 1) die("data didn't change after bay_propagate\n"); - - if (bay_remove(bay, &chan) != 0) - die("bay_remove failed\n"); } int main(void) @@ -93,7 +68,6 @@ int main(void) struct bay bay; bay_init(&bay); - test_remove(&bay); test_duplicate(&bay); test_callback(&bay);