Hi Hans, thanks for looking into this. On Mon, May 17, 2021 at 11:23 AM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: > So now we to this devm_kmalloc both in apply_acpi_orientation() if it succeeds > as well as here if apply_acpi_orientation() fails. It would be better to just > stop kmallocing it all together in both places and just embed the struct in adata, > iow make adata->mount_matrix be the actual iio_mount_matrix struct, rather then > a pointer to it. The reason it is just a pointer (IIUC) is that adata is shared across all ST sensors, including accelerometers, gyro and magnetometer (which may indeed use it) but also including pressure sensors, so there it is surplus. That said, I don't think it's a big deal, a few bytes less or more, so let's take that approach. Yours, Linus Walleij