Re: [PATCH 1/9] regmap: spi: Set regmap max raw r/w from max_transfer_size

From: Mark Brown
Date: Tue Aug 24 2021 - 12:43:16 EST


On Tue, Aug 24, 2021 at 11:40:33AM +0100, Lucas Tanure wrote:

> + if (master->max_transfer_size) {
> + bus = kmemdup(&regmap_spi, sizeof(*bus), GFP_KERNEL);

We shouldn't be peering into the controller structure, use
spi_max_transfer_size() instead.

> + bus->max_raw_read = bus->max_raw_write = master->max_transfer_size(spi);

Just write two assignment statements, it's more legible all round.

Attachment: signature.asc
Description: PGP signature