Message ID | 20250415183447.396277-8-e.zanda1@gmail.com |
---|---|
State | New |
Headers | show |
Series | i2c: Replace dev_err() with dev_err_probe() | expand |
diff --git a/drivers/i2c/busses/i2c-virtio.c b/drivers/i2c/busses/i2c-virtio.c index 2a351f961b89..9b05ff53d3d7 100644 --- a/drivers/i2c/busses/i2c-virtio.c +++ b/drivers/i2c/busses/i2c-virtio.c @@ -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)
This simplifies the code while improving log. Signed-off-by: Enrico Zanda <e.zanda1@gmail.com> --- drivers/i2c/busses/i2c-virtio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)