Commit 74d26d76 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Lee Jones

mfd: ocelot-spi: Use spi_sync_transfer()

Use spi_sync_transfer() instead of hand-writing it.

It is less verbose.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: default avatarColin Foster <colin.foster@in-advantage.com>
Tested-by: default avatarColin Foster <colin.foster@in-advantage.com>
Link: https://lore.kernel.org/r/7af920eb686b719cb7eb39c832e3ad414e0e1e1a.1712258667.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 7777dc1f
...@@ -145,7 +145,6 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg ...@@ -145,7 +145,6 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
struct device *dev = context; struct device *dev = context;
struct ocelot_ddata *ddata; struct ocelot_ddata *ddata;
struct spi_device *spi; struct spi_device *spi;
struct spi_message msg;
unsigned int index = 0; unsigned int index = 0;
ddata = dev_get_drvdata(dev); ddata = dev_get_drvdata(dev);
...@@ -166,9 +165,7 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg ...@@ -166,9 +165,7 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
xfers[index].len = val_size; xfers[index].len = val_size;
index++; index++;
spi_message_init_with_transfers(&msg, xfers, index); return spi_sync_transfer(spi, xfers, index);
return spi_sync(spi, &msg);
} }
static int ocelot_spi_regmap_bus_write(void *context, const void *data, size_t count) static int ocelot_spi_regmap_bus_write(void *context, const void *data, size_t count)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment