summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qualcomm/qca_spi.c
diff options
context:
space:
mode:
authorStefan Wahren <stefan.wahren@i2se.com>2017-05-29 13:57:16 +0200
committerDavid S. Miller <davem@davemloft.net>2017-05-30 13:57:29 -0400
commit55b7a770aef7beeb45e69c4833a22c94a074dcb3 (patch)
tree2d6b26209a8b7abb49ea5b5797d0c14784641ef5 /drivers/net/ethernet/qualcomm/qca_spi.c
parent96a2227c3ff006bf600f1c2ef08f470f3ccae90e (diff)
downloadlinux-55b7a770aef7beeb45e69c4833a22c94a074dcb3.tar.bz2
net: qualcomm: move qcaspi_tx_cmd to qca_spi.c
The function qcaspi_tx_cmd() is only called from qca_spi.c. So we better move it there. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qualcomm/qca_spi.c')
-rw-r--r--drivers/net/ethernet/qualcomm/qca_spi.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
index 74646286fd0f..50adc4f626e3 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -192,6 +192,30 @@ qcaspi_read_legacy(struct qcaspi *qca, u8 *dst, u32 len)
}
static int
+qcaspi_tx_cmd(struct qcaspi *qca, u16 cmd)
+{
+ __be16 tx_data;
+ struct spi_message *msg = &qca->spi_msg1;
+ struct spi_transfer *transfer = &qca->spi_xfer1;
+ int ret;
+
+ tx_data = cpu_to_be16(cmd);
+ transfer->len = sizeof(tx_data);
+ transfer->tx_buf = &tx_data;
+ transfer->rx_buf = NULL;
+
+ ret = spi_sync(qca->spi_dev, msg);
+
+ if (!ret)
+ ret = msg->status;
+
+ if (ret)
+ qcaspi_spi_error(qca);
+
+ return ret;
+}
+
+static int
qcaspi_tx_frame(struct qcaspi *qca, struct sk_buff *skb)
{
u32 count;