From 0578036749d7f0ef456907434e20f45bebade44e Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Thu, 15 Dec 2022 16:09:06 +0900 Subject: [PATCH] block: fix device API The device internal API enum and function have been updated. Change-Id: Ib00500422c2bf54fbce5bd2f1a5b3028fbf102bd Signed-off-by: Youngjae Cho --- src/block/block.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/block/block.c b/src/block/block.c index f917551..6e72ab6 100644 --- a/src/block/block.c +++ b/src/block/block.c @@ -2889,7 +2889,8 @@ static void remove_whole_block_device(void) } } -static void block_poweroff_cb(const struct device_change_state_info *info, void *udata) +static void block_poweroff_cb(device_power_state_e prev_state, device_power_state_e next_state, + uint64_t wait_callback_id, device_power_transition_reason_e reason, void *udata) { static int status = 0; @@ -2902,7 +2903,7 @@ static void block_poweroff_cb(const struct device_change_state_info *info, void remove_whole_block_device(); terminate_threads(); - device_power_change_state_wait_done(info->id); + device_power_confirm_wait_callback(wait_callback_id); } static void booting_done(void) @@ -2924,7 +2925,7 @@ static void booting_done(void) /* if there is the attached device, try to mount */ block_init_from_udev_enumerate(); - ret_val = device_power_add_change_state_wait_callback(POWER_STATE_POWEROFF | POWER_STATE_REBOOT | POWER_STATE_EXIT, + ret_val = device_power_add_state_wait_callback(DEVICE_POWER_STATE_POWEROFF | DEVICE_POWER_STATE_REBOOT | DEVICE_POWER_STATE_EXIT, block_poweroff_cb, NULL); if (ret_val < 0) _E("Failed to call poweroff wait callback."); @@ -3899,7 +3900,7 @@ static void block_exit(void *data) udev_exit(NULL); /* unregister notifier for below each event */ - device_power_remove_change_state_wait_callback(POWER_STATE_POWEROFF | POWER_STATE_REBOOT | POWER_STATE_EXIT); + device_power_remove_state_wait_callback(DEVICE_POWER_STATE_POWEROFF | DEVICE_POWER_STATE_REBOOT | DEVICE_POWER_STATE_EXIT); /* unregister mmc uevent control routine */ ret_val = unregister_udev_uevent_control(&uh); -- 2.7.4