summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authormanu <manu@FreeBSD.org>2016-12-16 15:45:09 +0000
committermanu <manu@FreeBSD.org>2016-12-16 15:45:09 +0000
commita1b67611251f0d9870e08f509977a3849ba91574 (patch)
tree19a3cc6583be956dd704e981b48bedb9fa218f31 /sys/arm
parent5290398111e3cef5f2c770265af0a28de5e5d78a (diff)
downloadFreeBSD-src-a1b67611251f0d9870e08f509977a3849ba91574.zip
FreeBSD-src-a1b67611251f0d9870e08f509977a3849ba91574.tar.gz
MFC r309935:
Use the spibus accessor when applicable.
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/lpc/lpc_spi.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arm/lpc/lpc_spi.c b/sys/arm/lpc/lpc_spi.c
index a3986da..c9accc8 100644
--- a/sys/arm/lpc/lpc_spi.c
+++ b/sys/arm/lpc/lpc_spi.c
@@ -141,12 +141,14 @@ static int
lpc_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
{
struct lpc_spi_softc *sc = device_get_softc(dev);
- struct spibus_ivar *devi = SPIBUS_IVAR(child);
+ uint32_t cs;
uint8_t *in_buf, *out_buf;
int i;
+ spibus_get_cs(child, &cs);
+
/* Set CS active */
- lpc_gpio_set_state(child, devi->cs, 0);
+ lpc_gpio_set_state(child, cs, 0);
/* Wait for FIFO to be ready */
while ((lpc_spi_read_4(sc, LPC_SSP_SR) & LPC_SSP_SR_TNF) == 0);
@@ -168,7 +170,7 @@ lpc_spi_transfer(device_t dev, device_t child, struct spi_command *cmd)
}
/* Set CS inactive */
- lpc_gpio_set_state(child, devi->cs, 1);
+ lpc_gpio_set_state(child, cs, 1);
return (0);
}
OpenPOWER on IntegriCloud