netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: cx82310_eth: use common match macro
@ 2012-09-03  9:20 Bjørn Mork
  2012-09-03  9:20 ` [PATCH net-next 1/2] net: sierra_net: make private symbols static Bjørn Mork
       [not found] ` <1346664033-30284-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
  0 siblings, 2 replies; 6+ messages in thread
From: Bjørn Mork @ 2012-09-03  9:20 UTC (permalink / raw)
  To: netdev; +Cc: linux-usb, Bjørn Mork

Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
 drivers/net/usb/cx82310_eth.c |   11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/net/usb/cx82310_eth.c b/drivers/net/usb/cx82310_eth.c
index 49ab45e..1e207f0 100644
--- a/drivers/net/usb/cx82310_eth.c
+++ b/drivers/net/usb/cx82310_eth.c
@@ -302,18 +302,9 @@ static const struct driver_info	cx82310_info = {
 	.tx_fixup	= cx82310_tx_fixup,
 };
 
-#define USB_DEVICE_CLASS(vend, prod, cl, sc, pr) \
-	.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
-		       USB_DEVICE_ID_MATCH_DEV_INFO, \
-	.idVendor = (vend), \
-	.idProduct = (prod), \
-	.bDeviceClass = (cl), \
-	.bDeviceSubClass = (sc), \
-	.bDeviceProtocol = (pr)
-
 static const struct usb_device_id products[] = {
 	{
-		USB_DEVICE_CLASS(0x0572, 0xcb01, 0xff, 0, 0),
+		USB_DEVICE_AND_INTERFACE_INFO(0x0572, 0xcb01, 0xff, 0, 0),
 		.driver_info = (unsigned long) &cx82310_info
 	},
 	{ },
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next 1/2] net: sierra_net: make private symbols static
  2012-09-03  9:20 [PATCH net-next] net: cx82310_eth: use common match macro Bjørn Mork
@ 2012-09-03  9:20 ` Bjørn Mork
  2012-09-03 17:51   ` David Miller
       [not found] ` <1346664033-30284-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
  1 sibling, 1 reply; 6+ messages in thread
From: Bjørn Mork @ 2012-09-03  9:20 UTC (permalink / raw)
  To: netdev; +Cc: linux-usb, Bjørn Mork

Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
 drivers/net/usb/sierra_net.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index 7be49ea..596ddaa 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -560,7 +560,7 @@ static void sierra_net_defer_kevent(struct usbnet *dev, int work)
 /*
  * Sync Retransmit Timer Handler. On expiry, kick the work queue
  */
-void sierra_sync_timer(unsigned long syncdata)
+static void sierra_sync_timer(unsigned long syncdata)
 {
 	struct usbnet *dev = (struct usbnet *)syncdata;
 
@@ -866,8 +866,8 @@ static int sierra_net_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
 }
 
 /* ---------------------------- Transmit data path ----------------------*/
-struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
-		gfp_t flags)
+static struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev,
+					   struct sk_buff *skb, gfp_t flags)
 {
 	struct sierra_net_data *priv = sierra_net_get_private(dev);
 	u16 len;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next 2/2] net: sierra_net: rx_urb_size is constant
       [not found] ` <1346664033-30284-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
@ 2012-09-03  9:20   ` Bjørn Mork
  2012-09-03 17:51     ` David Miller
  2012-09-03 17:51   ` [PATCH net-next] net: cx82310_eth: use common match macro David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Bjørn Mork @ 2012-09-03  9:20 UTC (permalink / raw)
  To: netdev-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Bjørn Mork

The rx_urb_size is set to the same value for every device
supported by this driver.  No need to keep a per-device
data structure to do that. Replacing with a macro constant.

This was the last device specific info, and removing it
allows us to delete the sierra_net_info_data struct.

Signed-off-by: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
---
 drivers/net/usb/sierra_net.c |   17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index 596ddaa..7ae70e9 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -68,9 +68,8 @@ static	atomic_t iface_counter = ATOMIC_INIT(0);
  */
 #define SIERRA_NET_USBCTL_BUF_LEN	1024
 
-struct sierra_net_info_data {
-	u16 rx_urb_size;
-};
+/* Overriding the default usbnet rx_urb_size */
+#define SIERRA_NET_RX_URB_SIZE		(8 * 1024)
 
 /* Private data structure */
 struct sierra_net_data {
@@ -678,9 +677,6 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
 	static const u8 shdwn_tmplate[sizeof(priv->shdwn_msg)] = {
 		0x00, 0x00, SIERRA_NET_HIP_SHUTD_ID, 0x00};
 
-	struct sierra_net_info_data *data =
-			(struct sierra_net_info_data *)dev->driver_info->data;
-
 	dev_dbg(&dev->udev->dev, "%s", __func__);
 
 	ifacenum = intf->cur_altsetting->desc.bInterfaceNumber;
@@ -725,9 +721,9 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
 	sierra_net_set_ctx_index(priv, 0);
 
 	/* decrease the rx_urb_size and max_tx_size to 4k on USB 1.1 */
-	dev->rx_urb_size  = data->rx_urb_size;
+	dev->rx_urb_size  = SIERRA_NET_RX_URB_SIZE;
 	if (dev->udev->speed != USB_SPEED_HIGH)
-		dev->rx_urb_size  = min_t(size_t, 4096, data->rx_urb_size);
+		dev->rx_urb_size  = min_t(size_t, 4096, SIERRA_NET_RX_URB_SIZE);
 
 	dev->net->hard_header_len += SIERRA_NET_HIP_EXT_HDR_LEN;
 	dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
@@ -918,10 +914,6 @@ static struct sk_buff *sierra_net_tx_fixup(struct usbnet *dev,
 	return NULL;
 }
 
-static const struct sierra_net_info_data sierra_net_info_data_direct_ip = {
-	.rx_urb_size = 8 * 1024,
-};

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next] net: cx82310_eth: use common match macro
       [not found] ` <1346664033-30284-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
  2012-09-03  9:20   ` [PATCH net-next 2/2] net: sierra_net: rx_urb_size is constant Bjørn Mork
@ 2012-09-03 17:51   ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2012-09-03 17:51 UTC (permalink / raw)
  To: bjorn-yOkvZcmFvRU
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA

From: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>
Date: Mon,  3 Sep 2012 11:20:31 +0200

> Signed-off-by: Bjørn Mork <bjorn-yOkvZcmFvRU@public.gmane.org>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 1/2] net: sierra_net: make private symbols static
  2012-09-03  9:20 ` [PATCH net-next 1/2] net: sierra_net: make private symbols static Bjørn Mork
@ 2012-09-03 17:51   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-09-03 17:51 UTC (permalink / raw)
  To: bjorn; +Cc: netdev, linux-usb

From: Bjørn Mork <bjorn@mork.no>
Date: Mon,  3 Sep 2012 11:20:32 +0200

> Signed-off-by: Bjørn Mork <bjorn@mork.no>

Applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 2/2] net: sierra_net: rx_urb_size is constant
  2012-09-03  9:20   ` [PATCH net-next 2/2] net: sierra_net: rx_urb_size is constant Bjørn Mork
@ 2012-09-03 17:51     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-09-03 17:51 UTC (permalink / raw)
  To: bjorn; +Cc: netdev, linux-usb

From: Bjørn Mork <bjorn@mork.no>
Date: Mon,  3 Sep 2012 11:20:33 +0200

> The rx_urb_size is set to the same value for every device
> supported by this driver.  No need to keep a per-device
> data structure to do that. Replacing with a macro constant.
> 
> This was the last device specific info, and removing it
> allows us to delete the sierra_net_info_data struct.
> 
> Signed-off-by: Bjørn Mork <bjorn@mork.no>

Applied.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-03 17:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-03  9:20 [PATCH net-next] net: cx82310_eth: use common match macro Bjørn Mork
2012-09-03  9:20 ` [PATCH net-next 1/2] net: sierra_net: make private symbols static Bjørn Mork
2012-09-03 17:51   ` David Miller
     [not found] ` <1346664033-30284-1-git-send-email-bjorn-yOkvZcmFvRU@public.gmane.org>
2012-09-03  9:20   ` [PATCH net-next 2/2] net: sierra_net: rx_urb_size is constant Bjørn Mork
2012-09-03 17:51     ` David Miller
2012-09-03 17:51   ` [PATCH net-next] net: cx82310_eth: use common match macro David Miller

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).