diff options
author | Enrico Zanda <e.zanda1@gmail.com> | 2025-04-15 21:34:44 +0300 |
---|---|---|
committer | Andi Shyti <andi@smida.it> | 2025-05-19 23:23:55 +0300 |
commit | 26e3e92e134a1f4eb70c82af0008766bc014a3f6 (patch) | |
tree | 5e45c84c09ac9233aeb9370990364b19a20e06e8 /drivers/i2c | |
parent | a070c9e07ab15e85e92de5bde4ac9eed031a63e5 (diff) | |
download | linux-26e3e92e134a1f4eb70c82af0008766bc014a3f6.tar.xz |
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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-virtio.c | 7 |
1 files changed, 3 insertions, 4 deletions
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) |