From: Paulius Zaleckas <paulius.zaleckas-Ft0m5Q12RQ9xBelEqimL3w@public.gmane.org>
To: Denis Joseph Barrow <D.Barow-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev <netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Greg Kroah-Hartman <gregkh-l3A5Bk7waGM@public.gmane.org>
Subject: Re: hso: remove usb_driver_claim_interface()
Date: Wed, 10 Sep 2008 14:26:20 +0300 [thread overview]
Message-ID: <48C7AEDC.8060902@teltonika.lt> (raw)
In-Reply-To: <48C7A4F5.2070607-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
Denis Joseph Barrow wrote:
> Hi Paulius,
> I'm not in a position yet to know if this patch is good, yet at least.
> hso_probe gets called once for each serial ttyHSx device
> usually four per usb stick modem & once for the hsox network device
> per modem.
>
> From the comment on usb_driver_claim_interface
> * This is used by usb device drivers that need to claim more than one
> * interface on a device when probing (audio and acm are current examples).
>
> I'm not used to USB terminology
> From my understanding of the code
> we are claiming more than one interface on the usb modem multiple ttyHSx devices
> & one network device. However we get probed once for each interface
usb_driver_claim_interface() is needed only when you want to claim
additional interface.
> We are also calling usb_driver_release_interface from hso_disconnect.
> This looks a little asymmetrical to me.
Nice catch. usb_driver_release_interface() is not needed there too.
This is some code from usb_driver_release_interface():
/* don't release from within disconnect() */
if (iface->condition != USB_INTERFACE_BOUND)
return;
So since hso_disconnect is usb disconnect(), function call to
usb_driver_release_interface() just returns without any action.
I will prepare patch for this one too.
Greg: Maybe we should put warning in this check to catch other
driver from misusing this function?
> Greg is this patch good? I've no problem with it if it gets your guys blessing.
>
>
> Index: linux-2.6/drivers/net/usb/hso.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/usb/hso.c
> +++ linux-2.6/drivers/net/usb/hso.c
> @@ -2487,8 +2487,6 @@ static int hso_probe(struct usb_interfac
> goto exit;
> }
>
> - usb_driver_claim_interface(&hso_driver, interface, hso_dev);
> -
> /* save our data pointer in this device */
> usb_set_intfdata(interface, hso_dev);
>
>
>
>
> Paulius Zaleckas wrote:
>
--
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
next prev parent reply other threads:[~2008-09-10 11:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-10 9:06 hso: remove usb_driver_claim_interface() Paulius Zaleckas
2008-09-10 10:44 ` Denis Joseph Barrow
[not found] ` <48C7A4F5.2070607-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org>
2008-09-10 11:26 ` Paulius Zaleckas [this message]
2008-09-10 11:34 ` Denis Joseph Barrow
2008-09-10 11:44 ` Paulius Zaleckas
2008-09-10 11:56 ` Denis Joseph Barrow
2008-09-10 13:55 ` Alan Stern
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=48C7AEDC.8060902@teltonika.lt \
--to=paulius.zaleckas-ft0m5q12rq9xbeleqiml3w@public.gmane.org \
--cc=D.Barow-x9gZzRpC1QbQT0dZR+AlfA@public.gmane.org \
--cc=gregkh-l3A5Bk7waGM@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@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).