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:
parent
e59ee182f8
commit
ce2635f410
3 changed files with 5 additions and 9 deletions
|
@ -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"
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue