drivers: adc: Refactor code to remove warning
drivers: adc: Refactor code to remove warning

Refactor code so that an unused variable 'adc' warning
is not generated when building for CONFIG_SOC_SERIES_STM32G4X
and not using adc1 or adc5.

Signed-off-by: Sam Hurst <f5a9a7a3c43e6bdd2ccfb8b7fc2e1bb9f1b6bcb2@gmail.com>

zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,finikorg/zephyr,finikorg/zephyr,galak/zephyr,galak/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr