summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Sobrie <olivier@sobrie.be>2015-01-30 15:22:03 +0300
committerDavid S. Miller <davem@davemloft.net>2015-02-01 23:33:27 +0300
commit38121067b10268385ca00978d1c1a241cd5eadfb (patch)
treef85a75e5222c2ea3a10a2463f092ff017f7709c9
parentcc491970f5cef560b9e5bf037f0c9dd1e4d6a4bd (diff)
downloadlinux-38121067b10268385ca00978d1c1a241cd5eadfb.tar.xz
hso: fix rfkill name conflicts
By using only the usb interface number for the rfkill name, we might have a name conflicts in case two similar hso devices are connected. In this patch, the name of the hso rfkill interface embed the value of a counter that is incremented each time a new rfkill interface is added. Suggested-by: Dan Williams <dcbw@redhat.com> Signed-off-by: Olivier Sobrie <olivier@sobrie.be> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/usb/hso.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index e94a02395357..7833bd1d9791 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -153,7 +153,7 @@ struct hso_net {
struct hso_device *parent;
struct net_device *net;
struct rfkill *rfkill;
- char name[8];
+ char name[24];
struct usb_endpoint_descriptor *in_endp;
struct usb_endpoint_descriptor *out_endp;
@@ -2469,9 +2469,10 @@ static void hso_create_rfkill(struct hso_device *hso_dev,
{
struct hso_net *hso_net = dev2net(hso_dev);
struct device *dev = &hso_net->net->dev;
+ static u32 rfkill_counter;
snprintf(hso_net->name, sizeof(hso_net->name), "hso-%d",
- interface->altsetting->desc.bInterfaceNumber);
+ rfkill_counter++);
hso_net->rfkill = rfkill_alloc(hso_net->name,
&interface_to_usbdev(interface)->dev,