virtio: simplify of_node handling in virtio_device_of_init
PATCH 1/1 virtio: simplify of_node handling in virtio_device_of_init
Replace goto with return for simple error
Signed-off-by Clement Amar <[email protected]>
--- drivers/virtio/virtio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/virtio/virtio.c +2 -6
@@ -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; }/**
Signature · 1 line
2.43.0
Michael S. Tsirkin
maintainerQuoted 3 lines · Clement Amar
Replace goto with return for simple error
Signed-off-by Clement Amar <[email protected]>
I don't see the point, sorry.
Quoted 29 lines
--- drivers/virtio/virtio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)drivers/virtio/virtio.c +2
-6@@ -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; }/** Signature · 1 line
2.43.0