iio: frequency: admv1014: return -EINVAL directly
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Fri, 19 Aug 2022 10:41:17 +0000 (13:41 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 19 Aug 2022 17:07:22 +0000 (18:07 +0100)
Remove extra step where the error code is assigned to the `ret`
variable.

Return instead error code directly.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://lore.kernel.org/r/20220819104117.4600-1-antoniu.miclaus@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/frequency/admv1014.c

index 865addd10db44dc952ba8c872c85b7774578c8c6..bb5e1feef42bfc09fac9955613c0c154ab1fe44a 100644 (file)
@@ -669,8 +669,7 @@ static int admv1014_init(struct admv1014_state *st)
        chip_id = FIELD_GET(ADMV1014_CHIP_ID_MSK, chip_id);
        if (chip_id != ADMV1014_CHIP_ID) {
                dev_err(&spi->dev, "Invalid Chip ID.\n");
-               ret = -EINVAL;
-               return ret;
+               return -EINVAL;
        }
 
        ret = __admv1014_spi_update_bits(st, ADMV1014_REG_QUAD,