]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: dac: adi-axi-dac: Make use of dev_err_probe()
authorNuno Sá <nuno.sa@analog.com>
Mon, 22 Dec 2025 13:48:02 +0000 (13:48 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 31 Dec 2025 17:59:26 +0000 (17:59 +0000)
Be consistent and use dev_err_probe() as in all other places in the
.probe() path.

While at it, remove the line break in the version condition. Yes, it
goes over the 80 column limit but I do think the line break hurts
readability in this case.

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/adi-axi-dac.c

index 851d837d7ced3df15fa4aca31357250b6b72d380..9cc895bbe51a17e02e9584693d443622e0e1f906 100644 (file)
@@ -942,18 +942,15 @@ static int axi_dac_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       if (ADI_AXI_PCORE_VER_MAJOR(ver) !=
-               ADI_AXI_PCORE_VER_MAJOR(st->info->version)) {
-               dev_err(dev,
-                       "Major version mismatch. Expected %d.%.2d.%c, Reported %d.%.2d.%c\n",
-                       ADI_AXI_PCORE_VER_MAJOR(st->info->version),
-                       ADI_AXI_PCORE_VER_MINOR(st->info->version),
-                       ADI_AXI_PCORE_VER_PATCH(st->info->version),
-                       ADI_AXI_PCORE_VER_MAJOR(ver),
-                       ADI_AXI_PCORE_VER_MINOR(ver),
-                       ADI_AXI_PCORE_VER_PATCH(ver));
-               return -ENODEV;
-       }
+       if (ADI_AXI_PCORE_VER_MAJOR(ver) != ADI_AXI_PCORE_VER_MAJOR(st->info->version))
+               return dev_err_probe(dev, -ENODEV,
+                                    "Major version mismatch. Expected %d.%.2d.%c, Reported %d.%.2d.%c\n",
+                                    ADI_AXI_PCORE_VER_MAJOR(st->info->version),
+                                    ADI_AXI_PCORE_VER_MINOR(st->info->version),
+                                    ADI_AXI_PCORE_VER_PATCH(st->info->version),
+                                    ADI_AXI_PCORE_VER_MAJOR(ver),
+                                    ADI_AXI_PCORE_VER_MINOR(ver),
+                                    ADI_AXI_PCORE_VER_PATCH(ver));
 
        /* Let's get the core read only configuration */
        ret = regmap_read(st->regmap, AXI_DAC_CONFIG_REG, &st->reg_config);