gpio: 74x164: Switch to use dev_err_probe()

Switch to use dev_err_probe() to simplify the error path and
unify a message template.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250207151825.2122419-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
Andy Shevchenko 2025-02-07 17:17:13 +02:00 committed by Bartosz Golaszewski
parent abe3817fa1
commit 9bd2dbe406

View File

@ -125,10 +125,8 @@ static int gen_74x164_probe(struct spi_device *spi)
return ret;
ret = device_property_read_u32(&spi->dev, "registers-number", &nregs);
if (ret) {
dev_err(&spi->dev, "Missing 'registers-number' property.\n");
return -EINVAL;
}
if (ret)
return dev_err_probe(dev, ret, "Missing 'registers-number' property.\n");
chip = devm_kzalloc(dev, struct_size(chip, buffer, nregs), GFP_KERNEL);
if (!chip)