ta_control: Move variable declaration to the top of the functionChange-Id: Ia5ada61d74f5b17c4d1479123462104650a6ed0f