drivers: virt: ivshmem: Convert to use DEVICE_DT_GET_ONE

Replace Kconfig (IVSHMEM_DEV_NAME) based named device_get_binding
with DEVICE_DT_GET_ONE.  Since there is only one driver for ivshmem
use the qemu,ivshmem for that.

Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
Kumar Gala 2022-07-19 13:17:49 -05:00 committed by Carles Cufí
commit ce2635f410
3 changed files with 5 additions and 9 deletions

View file

@ -22,10 +22,6 @@ config IVSHMEM
if IVSHMEM
config IVSHMEM_DEV_NAME
string
default "IVSHMEM"
module = IVSHMEM
module-str = ivshmem
source "subsys/logging/Kconfig.template.log_config"

View file

@ -49,9 +49,9 @@ static void doorbell_notification_thread(const struct shell *shell)
static bool get_ivshmem(const struct shell *shell)
{
if (ivshmem == NULL) {
ivshmem = device_get_binding(CONFIG_IVSHMEM_DEV_NAME);
if (!ivshmem) {
shell_error(shell, "IVshmem device cannot be found");
ivshmem = DEVICE_DT_GET_ONE(qemu_ivshmem);
if (!device_is_ready(ivshmem)) {
shell_error(shell, "IVshmem device is not ready");
}
}