From: Clement Amar <clementamar@gmail.com>
To: "Michael S . Tsirkin" <mst@redhat.com>
Cc: "Jason Wang" <jasowang@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
"Clement Amar" <clementamar@gmail.com>
Subject: [PATCH] virtio: simplify of_node handling in virtio_device_of_init
Date: Mon, 6 Apr 2026 11:21:59 +0200 [thread overview]
Message-ID: <20260406092159.136447-1-clementamar@gmail.com> (raw)
Replace goto with return for simple error
Signed-off-by: Clement Amar <clementamar@gmail.com>
---
drivers/virtio/virtio.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c
index 5bdc6b82b..b49113ea8 100644
--- a/drivers/virtio/virtio.c
+++ b/drivers/virtio/virtio.c
@@ -493,16 +493,12 @@ static int virtio_device_of_init(struct virtio_device *dev)
* Simply don't init of_node in this case.
*/
if (!of_device_is_compatible(np, compat)) {
- ret = 0;
- goto out;
+ of_node_put(np);
+ return 0;
}
dev->dev.of_node = np;
return 0;
-
-out:
- of_node_put(np);
- return ret;
}
/**
--
2.43.0
next reply other threads:[~2026-04-06 9:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 9:21 Clement Amar [this message]
2026-04-06 9:26 ` [PATCH] virtio: simplify of_node handling in virtio_device_of_init Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260406092159.136447-1-clementamar@gmail.com \
--to=clementamar@gmail.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.