In device removal routine, usage of "#ifdef CONFIG_RT2X00_LIB_USB"will not cover the case when it is configured as module. This willomit the entire if-block which does cleanup of URBs and cancellationof pending work. Changing the #ifdef to #if IS_ENABLED() to fix it.