From: Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
To: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
Jiri Slaby <jslaby-IBi9RG/b67k@public.gmane.org>,
linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
Subject: [PATCH v5 04/17] net: qualcomm: use net_device_ops instead of direct call
Date: Wed, 10 May 2017 10:53:15 +0200 [thread overview]
Message-ID: <1494406408-31760-5-git-send-email-stefan.wahren@i2se.com> (raw)
In-Reply-To: <1494406408-31760-1-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
There is no need to export qcaspi_netdev_open and qcaspi_netdev_close
because they are also accessible via the net_device_ops.
Signed-off-by: Stefan Wahren <stefan.wahren-eS4NqCHxEME@public.gmane.org>
---
drivers/net/ethernet/qualcomm/qca_debug.c | 5 +++--
drivers/net/ethernet/qualcomm/qca_spi.c | 4 ++--
drivers/net/ethernet/qualcomm/qca_spi.h | 3 ---
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/qualcomm/qca_debug.c b/drivers/net/ethernet/qualcomm/qca_debug.c
index d145df9..92b6be9 100644
--- a/drivers/net/ethernet/qualcomm/qca_debug.c
+++ b/drivers/net/ethernet/qualcomm/qca_debug.c
@@ -275,6 +275,7 @@ qcaspi_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring)
static int
qcaspi_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring)
{
+ const struct net_device_ops *ops = dev->netdev_ops;
struct qcaspi *qca = netdev_priv(dev);
if ((ring->rx_pending) ||
@@ -283,13 +284,13 @@ qcaspi_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring)
return -EINVAL;
if (netif_running(dev))
- qcaspi_netdev_close(dev);
+ ops->ndo_stop(dev);
qca->txr.count = max_t(u32, ring->tx_pending, TX_RING_MIN_LEN);
qca->txr.count = min_t(u16, qca->txr.count, TX_RING_MAX_LEN);
if (netif_running(dev))
- qcaspi_netdev_open(dev);
+ ops->ndo_open(dev);
return 0;
}
diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
index 8590109..5c79612 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -602,7 +602,7 @@ qcaspi_intr_handler(int irq, void *data)
return IRQ_HANDLED;
}
-int
+static int
qcaspi_netdev_open(struct net_device *dev)
{
struct qcaspi *qca = netdev_priv(dev);
@@ -639,7 +639,7 @@ qcaspi_netdev_open(struct net_device *dev)
return 0;
}
-int
+static int
qcaspi_netdev_close(struct net_device *dev)
{
struct qcaspi *qca = netdev_priv(dev);
diff --git a/drivers/net/ethernet/qualcomm/qca_spi.h b/drivers/net/ethernet/qualcomm/qca_spi.h
index 6e31a0e..064853d 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.h
+++ b/drivers/net/ethernet/qualcomm/qca_spi.h
@@ -108,7 +108,4 @@ struct qcaspi {
u16 burst_len;
};
-int qcaspi_netdev_open(struct net_device *dev);
-int qcaspi_netdev_close(struct net_device *dev);
-
#endif /* _QCA_SPI_H */
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-05-10 8:53 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-10 8:53 [PATCH v5 00/17] net: qualcomm: add QCA7000 UART driver Stefan Wahren
2017-05-10 8:53 ` [PATCH v5 01/17] net: qualcomm: remove unnecessary includes Stefan Wahren
2017-05-10 8:53 ` [PATCH v5 02/17] net: qca_framing: use u16 for frame offset Stefan Wahren
2017-05-10 8:53 ` [PATCH v5 03/17] net: qca_7k: Use BIT macro Stefan Wahren
[not found] ` <1494406408-31760-1-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2017-05-10 8:53 ` Stefan Wahren [this message]
2017-05-10 8:53 ` [PATCH v5 05/17] net: qualcomm: Improve readability of length defines Stefan Wahren
2017-05-10 8:53 ` [PATCH v5 06/17] net: qca_spi: remove QCASPI_MTU Stefan Wahren
2017-05-10 8:53 ` [PATCH v5 07/17] net: qualcomm: move qcaspi_tx_cmd to qca_spi.c Stefan Wahren
2017-05-10 8:53 ` [PATCH v5 08/17] net: qca_spi: Clarify MODULE_DESCRIPTION Stefan Wahren
2017-05-10 8:53 ` [PATCH v5 09/17] net: qualcomm: rename qca_framing.c to qca_7k_common.c Stefan Wahren
2017-05-10 8:53 ` [PATCH v5 10/17] net: qualcomm: prepare frame decoding for UART driver Stefan Wahren
2017-05-10 8:53 ` [PATCH v5 11/17] net: qualcomm: make qca_7k_common a separate kernel module Stefan Wahren
2017-05-10 8:53 ` [PATCH v5 12/17] dt-bindings: qca7000-spi: Rework binding Stefan Wahren
2017-05-10 8:53 ` [PATCH v5 13/17] dt-bindings: qca7000: rename binding Stefan Wahren
[not found] ` <1494406408-31760-14-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2017-05-11 19:48 ` Michael Heimpold
2017-05-10 8:53 ` [PATCH v5 14/17] dt-bindings: slave-device: add current-speed property Stefan Wahren
2017-05-13 0:05 ` Rob Herring
2017-05-10 8:53 ` [PATCH v5 15/17] dt-bindings: qca7000: append UART interface to binding Stefan Wahren
[not found] ` <1494406408-31760-16-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2017-05-11 19:12 ` Michael Heimpold
2017-05-11 20:38 ` Rob Herring
2017-05-12 2:45 ` Jakub Kicinski
2017-05-12 6:15 ` Michael Heimpold
[not found] ` <20170512061552.Horde.ggjCMHnIsr8LeADwTQwhnx7-O4EMSK59OscLBGDc3sTiBZZV94DADvEd@public.gmane.org>
2017-05-12 6:43 ` Jakub Kicinski
[not found] ` <20170511234342.575d9226-68UzVGuGftmUSpRRplVxJ1aTQe2KTcn/@public.gmane.org>
2017-05-19 7:13 ` Stefan Wahren
[not found] ` <53509108-fac2-8e8d-9279-ed54e8c1af3b-eS4NqCHxEME@public.gmane.org>
2017-05-19 12:37 ` Rob Herring
2017-05-10 8:53 ` [PATCH v5 16/17] tty: serdev-ttyport: return actual baudrate from ttyport_set_baudrate Stefan Wahren
[not found] ` <1494406408-31760-17-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2017-05-17 11:58 ` Stefan Wahren
[not found] ` <d5533816-5d87-3772-19c0-5e57e519a3f1-eS4NqCHxEME@public.gmane.org>
2017-05-18 14:19 ` Greg Kroah-Hartman
2017-05-10 8:53 ` [PATCH v5 17/17] net: qualcomm: add QCA7000 UART driver Stefan Wahren
[not found] ` <1494406408-31760-18-git-send-email-stefan.wahren-eS4NqCHxEME@public.gmane.org>
2017-05-11 21:58 ` Lino Sanfilippo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1494406408-31760-5-git-send-email-stefan.wahren@i2se.com \
--to=stefan.wahren-es4nqchxeme@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=jslaby-IBi9RG/b67k@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).