Revert "resource-manager: Relocate add_resource() in create_resource()" 46/289946/1
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 16 Mar 2023 03:54:51 +0000 (12:54 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Thu, 16 Mar 2023 04:16:24 +0000 (13:16 +0900)
commitba823a0294b55f2eefa317a069578c6c64a26f8d
treeb6cb7618a42d35e3585d3a9d04592f089c0e4423
parent449dacb8dc4ee7692ad5336e126d187a10736a08
Revert "resource-manager: Relocate add_resource() in create_resource()"

This reverts commit 5880b22f3e55b60c7b9326c51012b95f05416145.

The resource instance must be added to hashtable prior to the operation
driver->ops.create(resource->id). As this operation passes resource id,
it is possible that the operation work based on that resource id, which
denotes resource instance and must have been registered to hashtable.
Therefore, add_resource() must be followed by driver->ops.create().

Change-Id: I05b8a9f85741313c14201501fe6bbc4a5b8c7233
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/resource-manager/resource-manager.c