dm: Move the function for getting GPIO status into the uclass