From e70de6ee8217ed04a080bb93238f6319cd55f676 Mon Sep 17 00:00:00 2001 From: Peter Bigot Date: Sat, 14 Mar 2020 11:01:38 -0500 Subject: [PATCH] power: device: fix name for Nordic clock driver The device power management infrastructure maintains a hard-coded list of critical devices to ensure suspend and resume are performed in the proper order. PR #21298 combined the 32 KiHz and 16 MHz clock devices into a single driver, changing the name so the clock driver is not handled at the correct time, but rather at whatever point it appears in the general device list. Update the list to the current clock driver name. Also store the device names as standard strings rather than padding them to a fixed length. Signed-off-by: Peter Bigot --- subsys/power/device.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/subsys/power/device.c b/subsys/power/device.c index 953fa04c857..2a9f7750322 100644 --- a/subsys/power/device.c +++ b/subsys/power/device.c @@ -24,10 +24,8 @@ LOG_MODULE_DECLARE(power); */ #if defined(CONFIG_SOC_FAMILY_NRF) #define MAX_PM_DEVICES 15 -#define MAX_DEV_NAME_LEN 16 -static const char core_devices[][MAX_DEV_NAME_LEN] = { - "CLOCK_32K", - "CLOCK_16M", +static const char *const core_devices[] = { + "CLOCK", "sys_clock", "UART_0", }; @@ -136,7 +134,7 @@ void sys_pm_create_device_list(void) j < ARRAY_SIZE(core_devices); j++) { if (!strcmp(pm_device_list[i].config->name, - &core_devices[j][0])) { + core_devices[j])) { is_core_dev = true; break; }