[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1339098621.13885.13.camel@wall-e>
Date: Thu, 07 Jun 2012 21:50:21 +0200
From: Stefani Seibold <stefani@...bold.net>
To: Alan Stern <stern@...land.harvard.edu>
Cc: Greg KH <gregkh@...uxfoundation.org>, linux-kernel@...r.kernel.org,
oneukum@...e.de, alan@...rguk.ukuu.org.uk,
linux-usb@...r.kernel.org
Subject: Re: [PATCH 04/11] remove usb_interface pointer
Am Donnerstag, den 07.06.2012, 11:27 -0400 schrieb Alan Stern:
> On Thu, 7 Jun 2012, Stefani Seibold wrote:
> > I think it will be needed, since usb core will decrement the reference
> > when the device go away.
>
> But before it decrements the reference, it will unbind the driver. As
> long as usb-skeleton is careful not to access the device or the
> interface after the disconnect routine returns, it doesn't need to keep
> a reference.
>
> > Lock every access to the usb core if a tedious
> > thing and will waste a lot of code.
>
> With proper design, it's not necessary to lock every access.
> >
> > BTW: An interface have no reference count.
>
> Sure it does. Look at the definitions of usb_get_intf() and
> usb_put_intf() in drivers/usb/core/usb.c.
>
That what i am looking for. If we do an usb_get_intf() in the
skel_probe() function and an usb_put_intf() in skel_delete() function at
the end, then it should be save to access the usb_device pointer by
interface_to_usbdev() in the skel_delete() function. Right?
Greetings,
Stefani
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists