Skip to content

Commit aebb4b5

Browse files
committed
samples: i2c: fram: use node label instead of alias
Add more coverage by not using aliases and directly use node label. Fixes #38154 Signed-off-by: Anas Nashif <[email protected]>
1 parent a50a16e commit aebb4b5

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

samples/drivers/i2c_fujitsu_fram/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ tests:
44
sample.drivers.i2c.fujitsu_fram:
55
tags: drivers
66
depends_on: i2c
7-
filter: dt_alias_exists("i2c-0")
7+
filter: dt_nodelabel_enabled("i2c0")
88
harness: console
99
harness_config:
1010
type: one_line

samples/drivers/i2c_fujitsu_fram/src/main.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
#include <device.h>
1111
#include <drivers/i2c.h>
1212

13-
#define I2C_NODE DT_ALIAS(i2c_0)
14-
1513
/**
16-
* @file Sample app using the Fujitsu MB85RC256V FRAM through ARC I2C.
14+
* @file Sample app using the Fujitsu MB85RC256V FRAM through I2C.
1715
*/
1816

1917
#define FRAM_I2C_ADDR 0x50
@@ -72,7 +70,7 @@ static int read_bytes(const struct device *i2c_dev, uint16_t addr,
7270

7371
void main(void)
7472
{
75-
const struct device *i2c_dev = DEVICE_DT_GET(I2C_NODE);
73+
const struct device *i2c_dev = DEVICE_DT_GET(DT_NODELABEL(i2c0));
7674
uint8_t cmp_data[16];
7775
uint8_t data[16];
7876
int i, ret;

0 commit comments

Comments
 (0)