Skip to content

Commit 26e3e92

Browse files
zandaeAndi Shyti
authored andcommitted
i2c: virtio: Replace dev_err() with dev_err_probe() in probe function
This simplifies the code while improving log. Signed-off-by: Enrico Zanda <e.zanda1@gmail.com> Link: https://lore.kernel.org/r/20250415183447.396277-8-e.zanda1@gmail.com Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
1 parent a070c9e commit 26e3e92

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/i2c/busses/i2c-virtio.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,9 @@ static int virtio_i2c_probe(struct virtio_device *vdev)
192192
struct virtio_i2c *vi;
193193
int ret;
194194

195-
if (!virtio_has_feature(vdev, VIRTIO_I2C_F_ZERO_LENGTH_REQUEST)) {
196-
dev_err(&vdev->dev, "Zero-length request feature is mandatory\n");
197-
return -EINVAL;
198-
}
195+
if (!virtio_has_feature(vdev, VIRTIO_I2C_F_ZERO_LENGTH_REQUEST))
196+
return dev_err_probe(&vdev->dev, -EINVAL,
197+
"Zero-length request feature is mandatory\n");
199198

200199
vi = devm_kzalloc(&vdev->dev, sizeof(*vi), GFP_KERNEL);
201200
if (!vi)

0 commit comments

Comments
 (0)