drivers: pwm_nrf5_sw: Remove PWM_NRF5_SW_0_DEV_NAME Kconfig option

This option determines the name under which the device represented by
the `sw_pwm` node is registered in the system. But when the value of
this option does not match the `label` property of the `sw_pwm` node,
a problem arises when the `sw_pwm` node is referenced by a "pwm-leds"
compatible node, since the `*_PWMS_CONTROLLER` macro that is generated
for this referencing node contains a non-existing device name (as it is
the `label` property value, not the Kconfig option value).
This commit solves the issue described above by removing the Kconfig
option and replacing all of its occurrences in sample applications
by the standard macro generated for the `sw_pwm` node, containing
the value of the `label` property of this node.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2019-10-03 10:54:27 +02:00 committed by Carles Cufí
commit 5239bef610
5 changed files with 4 additions and 15 deletions

View file

@ -255,7 +255,7 @@ static const struct pwm_config pwm_nrf5_sw_0_config = {
static struct pwm_data pwm_nrf5_sw_0_data;
DEVICE_AND_API_INIT(pwm_nrf5_sw_0,
CONFIG_PWM_NRF5_SW_0_DEV_NAME,
DT_INST_0_NORDIC_NRF_SW_PWM_LABEL,
pwm_nrf5_sw_init,
&pwm_nrf5_sw_0_data,
&pwm_nrf5_sw_0_config,