All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] USB: core: drop outdated interface-binding comment
@ 2021-03-18 15:54 Johan Hovold
  2021-03-18 15:54 ` [PATCH 2/2] USB: core: rename usb_driver_claim_interface() data parameter Johan Hovold
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2021-03-18 15:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Johan Hovold

It's been almost twenty years since USB drivers returned a data pointer
from their probe routines in order to bind to an interface.

Time to update the documentation for usb_driver_claim_interface().

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/core/driver.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index 4dfa44d6cc3c..a1013d9da08d 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -526,10 +526,6 @@ static int usb_unbind_interface(struct device *dev)
  * No device driver should directly modify internal usb_interface or
  * usb_device structure members.
  *
- * Few drivers should need to use this routine, since the most natural
- * way to bind to an interface is to return the private data from
- * the driver's probe() method.
- *
  * Callers must own the device lock, so driver probe() entries don't need
  * extra locking, but other call contexts may need to explicitly claim that
  * lock.
-- 
2.26.2


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

* [PATCH 2/2] USB: core: rename usb_driver_claim_interface() data parameter
  2021-03-18 15:54 [PATCH 1/2] USB: core: drop outdated interface-binding comment Johan Hovold
@ 2021-03-18 15:54 ` Johan Hovold
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2021-03-18 15:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Johan Hovold

It's been almost twenty years since the interface "private data" pointer
was removed in favour of using the driver-data pointer of struct device.

Let's rename the driver-data parameter of usb_driver_claim_interface()
so that it better reflects how it's used.

Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/usb/core/driver.c | 6 +++---
 include/linux/usb.h       | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index a1013d9da08d..072968c40ade 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -519,7 +519,7 @@ static int usb_unbind_interface(struct device *dev)
  * @driver: the driver to be bound
  * @iface: the interface to which it will be bound; must be in the
  *	usb device's active configuration
- * @priv: driver data associated with that interface
+ * @data: driver data associated with that 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).
@@ -533,7 +533,7 @@ static int usb_unbind_interface(struct device *dev)
  * Return: 0 on success.
  */
 int usb_driver_claim_interface(struct usb_driver *driver,
-				struct usb_interface *iface, void *priv)
+				struct usb_interface *iface, void *data)
 {
 	struct device *dev;
 	int retval = 0;
@@ -550,7 +550,7 @@ int usb_driver_claim_interface(struct usb_driver *driver,
 		return -ENODEV;
 
 	dev->driver = &driver->drvwrap.driver;
-	usb_set_intfdata(iface, priv);
+	usb_set_intfdata(iface, data);
 	iface->needs_binding = 0;
 
 	iface->condition = USB_INTERFACE_BOUND;
diff --git a/include/linux/usb.h b/include/linux/usb.h
index d6a41841b93e..08c672e7ece2 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -841,7 +841,7 @@ extern int usb_free_streams(struct usb_interface *interface,
 
 /* used these for multi-interface device registration */
 extern int usb_driver_claim_interface(struct usb_driver *driver,
-			struct usb_interface *iface, void *priv);
+			struct usb_interface *iface, void *data);
 
 /**
  * usb_interface_claimed - returns true iff an interface is claimed
-- 
2.26.2


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

end of thread, other threads:[~2021-03-18 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 15:54 [PATCH 1/2] USB: core: drop outdated interface-binding comment Johan Hovold
2021-03-18 15:54 ` [PATCH 2/2] USB: core: rename usb_driver_claim_interface() data parameter Johan Hovold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.