Skip to content

Commit 93f2fed

Browse files
galakcarlescufi
authored andcommitted
drivers: gpio: lpc11u6x: Remove DT_LABEL usage
Remove DT_LABEL usage that is needed for device_get_binding, replace this with DEVICE_DT_GET. Signed-off-by: Kumar Gala <[email protected]>
1 parent 3c5bf50 commit 93f2fed

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/gpio/gpio_lpc11u6x.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct lpc11u6x_pint_regs {
7979
* ports: GPIO and SYSCON registers base addresses, clock name and subsystem.
8080
*/
8181
struct gpio_lpc11u6x_shared {
82-
char *clock_controller_name;
82+
const struct device *clock_dev;
8383
clock_control_subsys_t clock_subsys;
8484
uint32_t gpio_base;
8585
uint32_t syscon_base;
@@ -495,7 +495,7 @@ static const struct gpio_driver_api gpio_lpc11u6x_driver_api = {
495495
*/
496496

497497
static const struct gpio_lpc11u6x_shared gpio_lpc11u6x_shared = {
498-
.clock_controller_name = DT_LABEL(DT_INST_PHANDLE(0, clocks)),
498+
.clock_dev = DEVICE_DT_GET(DT_INST_CLOCKS_CTLR(0)),
499499
.clock_subsys = (clock_control_subsys_t) DT_INST_PHA(0, clocks, clkid),
500500
.gpio_base = DT_INST_REG_ADDR_BY_IDX(0, 0),
501501
.syscon_base = DT_INST_REG_ADDR_BY_IDX(0, 1),
@@ -513,7 +513,6 @@ do { \
513513
static int gpio_lpc11u6x_init(const struct device *dev)
514514
{
515515
const struct gpio_lpc11u6x_config *config = dev->config;
516-
const struct device *clock_dev;
517516
int ret;
518517
static bool gpio_ready;
519518

@@ -523,12 +522,7 @@ static int gpio_lpc11u6x_init(const struct device *dev)
523522
}
524523

525524
/* Enable GPIO and PINT clocks. */
526-
clock_dev = device_get_binding(config->shared->clock_controller_name);
527-
if (!clock_dev) {
528-
return -ENODEV;
529-
}
530-
531-
ret = clock_control_on(clock_dev, config->shared->clock_subsys);
525+
ret = clock_control_on(config->shared->clock_dev, config->shared->clock_subsys);
532526
if (ret < 0) {
533527
return ret;
534528
}

0 commit comments

Comments
 (0)