mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 13:03:25 +01:00
mfd: ocelot-spi: Use spi_sync_transfer()
Use spi_sync_transfer() instead of hand-writing it. It is less verbose. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Colin Foster <colin.foster@in-advantage.com> Tested-by: Colin Foster <colin.foster@in-advantage.com> Link: https://lore.kernel.org/r/7af920eb686b719cb7eb39c832e3ad414e0e1e1a.1712258667.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
parent
7777dc1f91
commit
74d26d76b9
1 changed files with 1 additions and 4 deletions
|
@ -145,7 +145,6 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
|
|||
struct device *dev = context;
|
||||
struct ocelot_ddata *ddata;
|
||||
struct spi_device *spi;
|
||||
struct spi_message msg;
|
||||
unsigned int index = 0;
|
||||
|
||||
ddata = dev_get_drvdata(dev);
|
||||
|
@ -166,9 +165,7 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
|
|||
xfers[index].len = val_size;
|
||||
index++;
|
||||
|
||||
spi_message_init_with_transfers(&msg, xfers, index);
|
||||
|
||||
return spi_sync(spi, &msg);
|
||||
return spi_sync_transfer(spi, xfers, index);
|
||||
}
|
||||
|
||||
static int ocelot_spi_regmap_bus_write(void *context, const void *data, size_t count)
|
||||
|
|
Loading…
Reference in a new issue