@@ -79,7 +79,7 @@ struct lpc11u6x_pint_regs {
79
79
* ports: GPIO and SYSCON registers base addresses, clock name and subsystem.
80
80
*/
81
81
struct gpio_lpc11u6x_shared {
82
- char * clock_controller_name ;
82
+ const struct device * clock_dev ;
83
83
clock_control_subsys_t clock_subsys ;
84
84
uint32_t gpio_base ;
85
85
uint32_t syscon_base ;
@@ -495,7 +495,7 @@ static const struct gpio_driver_api gpio_lpc11u6x_driver_api = {
495
495
*/
496
496
497
497
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 )),
499
499
.clock_subsys = (clock_control_subsys_t ) DT_INST_PHA (0 , clocks , clkid ),
500
500
.gpio_base = DT_INST_REG_ADDR_BY_IDX (0 , 0 ),
501
501
.syscon_base = DT_INST_REG_ADDR_BY_IDX (0 , 1 ),
@@ -513,7 +513,6 @@ do { \
513
513
static int gpio_lpc11u6x_init (const struct device * dev )
514
514
{
515
515
const struct gpio_lpc11u6x_config * config = dev -> config ;
516
- const struct device * clock_dev ;
517
516
int ret ;
518
517
static bool gpio_ready ;
519
518
@@ -523,12 +522,7 @@ static int gpio_lpc11u6x_init(const struct device *dev)
523
522
}
524
523
525
524
/* 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 );
532
526
if (ret < 0 ) {
533
527
return ret ;
534
528
}
0 commit comments