[PATCH] em28xx: simplify argument passing to em28xx_init_dev()

DORMANTno replies

From: Thomas Petazzoni <hidden>
Date: 2012-01-07 14:18:54
Subsystem: media input infrastructure (v4l/dvb), the rest · Maintainers: Mauro Carvalho Chehab, Linus Torvalds

The 'struct em28xx *' pointer was passed by reference to the
em28xx_init_dev() function, for no reason. Instead, just pass it by
value, which is much more logical and simple.

Signed-off-by: Thomas Petazzoni <redacted>
---
 drivers/media/video/em28xx/em28xx-cards.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 9b747c2..789054d 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -2832,11 +2832,10 @@ void em28xx_release_resources(struct em28xx *dev)
  * em28xx_init_dev()
  * allocates and inits the device structs, registers i2c bus and v4l device
  */
-static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
+static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
 			   struct usb_interface *interface,
 			   int minor)
 {
-	struct em28xx *dev = *devhandle;
 	int retval;
 
 	dev->udev = udev;
@@ -3226,7 +3225,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
 	/* allocate device struct */
 	mutex_init(&dev->lock);
 	mutex_lock(&dev->lock);
-	retval = em28xx_init_dev(&dev, udev, interface, nr);
+	retval = em28xx_init_dev(dev, udev, interface, nr);
 	if (retval) {
 		mutex_unlock(&dev->lock);
 		kfree(dev->alt_max_pkt_size);
-- 
1.7.4.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help