Skip to content

Commit

Permalink
driver/vhost: Call metal_init in vhost_register_drivers
Browse files Browse the repository at this point in the history
since libmetal come from OpenAMP need be initialized before working

Signed-off-by: Xiang Xiao <[email protected]>
  • Loading branch information
xiaoxiang781216 committed Oct 5, 2024
1 parent 8d1c5d7 commit 97c9660
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/vhost/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,20 @@ int vhost_unregister_device(FAR struct vhost_device *device)

void vhost_register_drivers(void)
{
struct metal_init_params params = METAL_INIT_DEFAULTS;
int ret;

ret = metal_init(&params);
if (ret < 0)
{
vhosterr("metal_init failed, ret=%d\n", ret);
}

#ifdef CONFIG_DRIVERS_VHOST_RNG
ret = vhost_register_rng_driver();
if (ret < 0)
{
vrterr("vhost_register_rng_driver failed, ret=%d\n", ret);
vhosterr("vhost_register_rng_driver failed, ret=%d\n", ret);
}
#endif

Expand Down

0 comments on commit 97c9660

Please sign in to comment.