[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <92a8c1d1-82a0-4c91-a5ba-bffd574f3532@kernel.org>
Date: Mon, 25 Nov 2024 14:47:49 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Robert Budai <robert.budai@...log.com>,
Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Nuno Sa <nuno.sa@...log.com>,
Ramona Gradinariu <ramona.gradinariu@...log.com>,
Antoniu Miclaus <antoniu.miclaus@...log.com>,
Jonathan Cameron <jic23@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Jonathan Corbet <corbet@....net>,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH 6/7] iio: imu: adis16550: add adis16550 support
On 25/11/2024 14:35, Robert Budai wrote:
...
> + indio_dev->name = spi_get_device_id(spi)->name;
> + indio_dev->channels = st->info->channels;
> + indio_dev->num_channels = st->info->num_channels;
> + indio_dev->available_scan_masks = adis16550_channel_masks;
> + indio_dev->info = &adis16550_info;
> + indio_dev->modes = INDIO_DIRECT_MODE;
> +
> + st->adis.ops = &adis16550_ops;
> +
> + st->adis.xfer = kcalloc(2, sizeof(*st->adis.xfer), GFP_KERNEL);
> + if (!st->adis.xfer)
> + return -ENOMEM;
> +
> + void *buffer_tmp __free(void) = kzalloc(ADIS16550_BURST_DATA_LEN + sizeof(u32),
> + GFP_KERNEL);
> + if (!buffer_tmp) {
> + kfree(st->adis.xfer);
> + return -ENOMEM;
> + }
> + st->adis.buffer = no_free_ptr(buffer_tmp);
> +
> + ret = devm_regulator_get_enable(dev, "vdd");
> + if (ret)
> + return dev_err_probe(dev, ret,
> + "Failed to get vdd regulator\n");
> +
> + ret = adis_init(&st->adis, indio_dev, spi, &adis16550_data);
> + if (ret)
> + return ret;
Why this error path does not free xfer but earlier does?
> +
> + ret = __adis_initial_startup(&st->adis);
> + if (ret)
> + return ret;
> +
> + ret = adis16550_config_sync(st);
> + if (ret)
> + return ret;
> +
> + ret = devm_adis_setup_buffer_and_trigger(&st->adis, indio_dev,
> + adis16550_trigger_handler);
> + if (ret)
> + return ret;
> +
> + ret = devm_iio_device_register(dev, indio_dev);
> + if (ret)
> + return ret;
> +
> + adis16550_debugfs_init(indio_dev);
> +
> + return 0;
> +}
> +
> +static const struct spi_device_id adis16550_id[] = {
> + { "adis16550", ADIS16550 },
> + { "adis16550w", ADIS16550W },
> + { }
> +};
> +MODULE_DEVICE_TABLE(spi, adis16550_id);
> +
> +static const struct of_device_id adis16550_of_match[] = {
> + { .compatible = "adi,adis16550" },
> + { .compatible = "adi,adis16550w" },
So devices are the same or do you have here un-synced tables?
Best regards,
Krzysztof
Powered by blists - more mailing lists