linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the v4l-dvb tree with the 2c tree
@ 2013-04-03  1:10 Stephen Rothwell
  0 siblings, 0 replies; only message in thread
From: Stephen Rothwell @ 2013-04-03  1:10 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: linux-next, linux-kernel, Lars-Peter Clausen, Wolfram Sang, Hans Verkuil

[-- Attachment #1: Type: text/plain, Size: 2358 bytes --]

Hi Mauro,

Today's linux-next merge of the v4l-dvb tree got a conflict in
drivers/staging/media/go7007/go7007-driver.c between commit bf51a8c5e0b6
("i2c: Ignore return value of i2c_del_adapter()") from the i2c tree and
commit d5d3a7cc127d ("[media] go7007: fix unregister/disconnect
handling") from the v4l-dvb tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc drivers/staging/media/go7007/go7007-driver.c
index 6f83c52,a5ca99d..0000000
--- a/drivers/staging/media/go7007/go7007-driver.c
+++ b/drivers/staging/media/go7007/go7007-driver.c
@@@ -201,13 -208,50 +208,47 @@@ static int init_i2c_module(struct i2c_a
  {
  	struct go7007 *go = i2c_get_adapdata(adapter);
  	struct v4l2_device *v4l2_dev = &go->v4l2_dev;
- 
- 	if (v4l2_i2c_new_subdev(v4l2_dev, adapter, type, addr, NULL))
+ 	struct v4l2_subdev *sd;
+ 	struct i2c_board_info info;
+ 
+ 	memset(&info, 0, sizeof(info));
+ 	strlcpy(info.type, i2c->type, sizeof(info.type));
+ 	info.addr = i2c->addr;
+ 	info.flags = i2c->flags;
+ 
+ 	sd = v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info, NULL);
+ 	if (sd) {
+ 		if (i2c->is_video)
+ 			go->sd_video = sd;
+ 		if (i2c->is_audio)
+ 			go->sd_audio = sd;
  		return 0;
+ 	}
+ 
+ 	printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", i2c->type);
+ 	return -EINVAL;
+ }
+ 
+ /*
+  * Detach and unregister the encoder.  The go7007 struct won't be freed
+  * until v4l2 finishes releasing its resources and all associated fds are
+  * closed by applications.
+  */
+ static void go7007_remove(struct v4l2_device *v4l2_dev)
+ {
+ 	struct go7007 *go = container_of(v4l2_dev, struct go7007, v4l2_dev);
+ 
+ 	v4l2_device_unregister(v4l2_dev);
+ 	if (go->hpi_ops->release)
+ 		go->hpi_ops->release(go);
+ 	if (go->i2c_adapter_online) {
 -		if (i2c_del_adapter(&go->i2c_adapter) == 0)
 -			go->i2c_adapter_online = 0;
 -		else
 -			v4l2_err(&go->v4l2_dev,
 -				"error removing I2C adapter!\n");
++		i2c_del_adapter(&go->i2c_adapter);
++		go->i2c_adapter_online = 0;
+ 	}
  
- 	dev_info(&adapter->dev,
- 		 "go7007: probing for module i2c:%s failed\n", type);
- 	return -1;
+ 	kfree(go->boot_fw);
+ 	go7007_v4l2_remove(go);
+ 	kfree(go);
  }
  
  /*

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-04-03  1:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-03  1:10 linux-next: manual merge of the v4l-dvb tree with the 2c tree Stephen Rothwell

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).