net: qualcomm: move qcaspi_tx_cmd to qca_spi.c
authorStefan Wahren <stefan.wahren@i2se.com>
Mon, 29 May 2017 11:57:16 +0000 (13:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 May 2017 17:57:29 +0000 (13:57 -0400)
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>
drivers/net/ethernet/qualcomm/qca_7k.c
drivers/net/ethernet/qualcomm/qca_7k.h
drivers/net/ethernet/qualcomm/qca_spi.c

index e9162e1f0c7fc1e7edd6259e86d504874e0b8eb0..ffe7a16bdfc840d859292f6939938b75fba15a41 100644 (file)
@@ -121,27 +121,3 @@ qcaspi_write_register(struct qcaspi *qca, u16 reg, u16 value)
 
        return ret;
 }
-
-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;
-}
index 4047f0aeb47a27510f76e0306466464dabfd6920..27124c2bb77acad774952193e9bf6db8130382b5 100644 (file)
@@ -67,6 +67,5 @@
 void qcaspi_spi_error(struct qcaspi *qca);
 int qcaspi_read_register(struct qcaspi *qca, u16 reg, u16 *result);
 int qcaspi_write_register(struct qcaspi *qca, u16 reg, u16 value);
-int qcaspi_tx_cmd(struct qcaspi *qca, u16 cmd);
 
 #endif /* _QCA_7K_H */
index 74646286fd0f9ffeda7279f99a197a40f03f11d5..50adc4f626e3e942bb73c5370a8901288359dfd4 100644 (file)
@@ -191,6 +191,30 @@ qcaspi_read_legacy(struct qcaspi *qca, u8 *dst, u32 len)
        return 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)
 {