Skip to content

Commit 11ef22e

Browse files
kltsengAnas Nashif
authored andcommitted
samples: drivers: rtc: change hard-coded device name
Change to use the device config name defined by driver's Kconfig for device binding, instead of hard-coding it which is not portable. Jira: ZEP-1764 Change-Id: I7af234ada73302eb062340740df2fc7a8539150d Signed-off-by: Kuo-Lang Tseng <[email protected]> (cherry picked from commit 1980325)
1 parent 985f842 commit 11ef22e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

samples/drivers/rtc/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void main(void)
2626
struct device *rtc_dev;
2727

2828
printk("Test RTC driver\n");
29-
rtc_dev = device_get_binding("RTC_0");
29+
rtc_dev = device_get_binding(CONFIG_RTC_0_NAME);
3030

3131
config.init_val = 0;
3232
config.alarm_enable = 1;

0 commit comments

Comments
 (0)