boards: arm: nrf: Convert to DT_LABEL() macro

Convert old dts_fixup.h style DT_GPIO_P0_DEV_NAME macro to new
DT_LABEL(DT_NODELABEL(gpio0))

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-04-17 06:21:46 -05:00 committed by Kumar Gala
commit 32133676b6
5 changed files with 13 additions and 9 deletions

View file

@ -14,7 +14,7 @@ LOG_MODULE_REGISTER(board_control, CONFIG_BOARD_ICARUS_LOG_LEVEL);
static void select_sim(void)
{
struct device *port = device_get_binding(DT_GPIO_P0_DEV_NAME);
struct device *port = device_get_binding(DT_LABEL(DT_NODELABEL(gpio0)));
if (!port) {
LOG_ERR("Could not get GPIO Device Binding");

View file

@ -11,8 +11,10 @@ static int board_degu_evk_init(struct device *dev)
{
ARG_UNUSED(dev);
struct device *gpio0 = device_get_binding(DT_GPIO_P0_DEV_NAME);
struct device *gpio1 = device_get_binding(DT_GPIO_P1_DEV_NAME);
struct device *gpio0 =
device_get_binding(DT_LABEL(DT_NODELABEL(gpio0)));
struct device *gpio1 =
device_get_binding(DT_LABEL(DT_NODELABEL(gpio1)));
/*
* Degu Evaluation Kit has a TPS22916C power switch.

View file

@ -289,15 +289,17 @@ static int init(struct device *dev)
struct device *p0;
struct device *p1;
p0 = device_get_binding(DT_GPIO_P0_DEV_NAME);
p0 = device_get_binding(DT_LABEL(DT_NODELABEL(gpio0)));
if (!p0) {
LOG_ERR("GPIO device " DT_GPIO_P0_DEV_NAME "not found!");
LOG_ERR("GPIO device " DT_LABEL(DT_NODELABEL(gpio0))
" not found!");
return -EIO;
}
p1 = device_get_binding(DT_GPIO_P1_DEV_NAME);
p1 = device_get_binding(DT_LABEL(DT_NODELABEL(gpio1)));
if (!p1) {
LOG_ERR("GPIO device " DT_GPIO_P1_DEV_NAME " not found!");
LOG_ERR("GPIO device " DT_LABEL(DT_NODELABEL(gpio1))
" not found!");
return -EIO;
}

View file

@ -22,7 +22,7 @@ int bt_hci_transport_setup(struct device *h4)
char c;
struct device *port;
port = device_get_binding(DT_GPIO_P0_DEV_NAME);
port = device_get_binding(DT_LABEL(DT_NODELABEL(gpio0)));
if (!port) {
return -EIO;
}

View file

@ -48,7 +48,7 @@ static int pwr_ctrl_init(struct device *dev)
#endif
static const struct pwr_ctrl_cfg vdd_pwr_ctrl_cfg = {
.port = DT_GPIO_P0_DEV_NAME,
.port = DT_LABEL(DT_NODELABEL(gpio0)),
.pin = VDD_PWR_CTRL_GPIO_PIN,
};