The error code is available in the log after return. In our case,
attaching a triggered buffer can only fail if we are out of memory, as
no other buffer is being attached. Remove duplicate error messages to
reduce noise in dmesg.

Reviewed-by: David Lechner <[email protected]>
Signed-off-by: Erikas Bitovtas <[email protected]>
---
 drivers/iio/light/vcnl4000.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index cd7e6ee42cc5..76aee16d479b 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -2033,11 +2033,8 @@ static int vcnl4000_probe(struct i2c_client *client)
                                                      NULL,
                                                      
data->chip_spec->trig_buffer_func,
                                                      
data->chip_spec->buffer_setup_ops);
-               if (ret < 0) {
-                       dev_err(&client->dev,
-                               "unable to setup iio triggered buffer\n");
+               if (ret < 0)
                        return ret;
-               }
        }
 
        if (client->irq && data->chip_spec->irq_thread) {
@@ -2047,10 +2044,8 @@ static int vcnl4000_probe(struct i2c_client *client)
                                                IRQF_ONESHOT,
                                                "vcnl4000_irq",
                                                indio_dev);
-               if (ret < 0) {
-                       dev_err(&client->dev, "irq request failed\n");
+               if (ret < 0)
                        return ret;
-               }
 
                ret = vcnl4010_probe_trigger(indio_dev);
                if (ret < 0)

-- 
2.53.0


Reply via email to