block: fix device API 34/285734/1 accepted/tizen/7.0/unified/20221220.180251
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 15 Dec 2022 07:09:06 +0000 (16:09 +0900)
committeryoungjae cho <y0.cho@samsung.com>
Mon, 19 Dec 2022 06:03:50 +0000 (06:03 +0000)
The device internal API enum and function have been updated.

Change-Id: Ib00500422c2bf54fbce5bd2f1a5b3028fbf102bd
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 0578036749d7f0ef456907434e20f45bebade44e)

src/block/block.c

index f917551..6e72ab6 100644 (file)
@@ -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);