Commit 26e3e92e authored by Enrico Zanda's avatar Enrico Zanda Committed by Andi Shyti
Browse files

i2c: virtio: Replace dev_err() with dev_err_probe() in probe function



This simplifies the code while improving log.

Signed-off-by: default avatarEnrico Zanda <e.zanda1@gmail.com>
Link: https://lore.kernel.org/r/20250415183447.396277-8-e.zanda1@gmail.com


Signed-off-by: default avatarAndi Shyti <andi.shyti@kernel.org>
parent a070c9e0
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -192,10 +192,9 @@ static int virtio_i2c_probe(struct virtio_device *vdev)
	struct virtio_i2c *vi;
	int ret;

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

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