iio: frequency: adf4350: Return -ENOMEM on memory allocation failure

adf4350_parse_dt() returns NULL only when devm_kzalloc() fails. The
caller should return -ENOMEM in this case, not -EINVAL.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Antoniu Miclaus 2026-02-11 19:10:06 +02:00 committed by Jonathan Cameron
parent 25ac1dea21
commit bc2cb23607

View File

@ -607,7 +607,7 @@ static int adf4350_probe(struct spi_device *spi)
if (dev_fwnode(&spi->dev)) {
pdata = adf4350_parse_dt(&spi->dev);
if (pdata == NULL)
return -EINVAL;
return -ENOMEM;
} else {
pdata = dev_get_platdata(&spi->dev);
}