Commit 28ec4ed8 authored by Martí Bolívar's avatar Martí Bolívar Committed by Christopher Friedt
Browse files

samples: lcd_hd44780: drop device_get_binding



Use DEVICE_DT_GET.

Signed-off-by: default avatarMartí Bolívar <marti.bolivar@nordicsemi.no>
parent cbc1e5d3
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@


#if defined(CONFIG_SOC_PART_NUMBER_SAM3X8E)
#define GPIO_DRV_NAME DT_LABEL(DT_NODELABEL(pioc))
#define GPIO_NODE DT_NODELABEL(pioc)
#else
#error "Unsupported GPIO driver"
#endif
@@ -527,11 +527,10 @@ void pi_lcd_init(const struct device *gpio_dev, uint8_t cols, uint8_t rows,

void main(void)
{
	const struct device *gpio_dev;
	const struct device *gpio_dev = DEVICE_DT_GET(GPIO_NODE);

	gpio_dev = device_get_binding(GPIO_DRV_NAME);
	if (!gpio_dev) {
		printk("Cannot find %s!\n", GPIO_DRV_NAME);
	if (!device_is_ready(gpio_dev)) {
		printk("Device %s not ready!\n", gpio_dev->name);
		return;
	}