Skip to content

Commit 74d26d7

Browse files
tititiou36lag-linaro
authored andcommitted
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 <[email protected]> Reviewed-by: Colin Foster <[email protected]> Tested-by: Colin Foster <[email protected]> Link: https://lore.kernel.org/r/7af920eb686b719cb7eb39c832e3ad414e0e1e1a.1712258667.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <[email protected]>
1 parent 7777dc1 commit 74d26d7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/mfd/ocelot-spi.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
145145
struct device *dev = context;
146146
struct ocelot_ddata *ddata;
147147
struct spi_device *spi;
148-
struct spi_message msg;
149148
unsigned int index = 0;
150149

151150
ddata = dev_get_drvdata(dev);
@@ -166,9 +165,7 @@ static int ocelot_spi_regmap_bus_read(void *context, const void *reg, size_t reg
166165
xfers[index].len = val_size;
167166
index++;
168167

169-
spi_message_init_with_transfers(&msg, xfers, index);
170-
171-
return spi_sync(spi, &msg);
168+
return spi_sync_transfer(spi, xfers, index);
172169
}
173170

174171
static int ocelot_spi_regmap_bus_write(void *context, const void *data, size_t count)

0 commit comments

Comments
 (0)