Commit 330aa047 authored by Martí Bolívar's avatar Martí Bolívar Committed by Christopher Friedt
Browse files

samples: i2c_fujitsu_fram: drop device_get_binding



Use DEVICE_DT_GET.

Signed-off-by: default avatarMartí Bolívar <marti.bolivar@nordicsemi.no>
parent 799315d3
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
#include <device.h>
#include <drivers/i2c.h>

#define I2C_DEV DT_LABEL(DT_ALIAS(i2c_0))
#define I2C_NODE DT_ALIAS(i2c_0)

/**
 * @file Sample app using the Fujitsu MB85RC256V FRAM through ARC I2C.
@@ -72,14 +72,13 @@ static int read_bytes(const struct device *i2c_dev, uint16_t addr,

void main(void)
{
	const struct device *i2c_dev;
	const struct device *i2c_dev = DEVICE_DT_GET(I2C_NODE);
	uint8_t cmp_data[16];
	uint8_t data[16];
	int i, ret;

	i2c_dev = device_get_binding(I2C_DEV);
	if (!i2c_dev) {
		printk("I2C: Device driver not found.\n");
	if (!device_is_ready(i2c_dev)) {
		printk("I2C: Device is not ready.\n");
		return;
	}