Subject: linux-next: manual merge of the staging tree with the v4l-dvb tree

From: Stephen Rothwell <[email-masked]>
Date: Mon, 8 Oct 2018 15:47:43 +1100

Hi all,

Today's linux-next merge of the staging tree got a conflict in:

  drivers/staging/media/imx/imx-media-dev.c

between commit:

  b803cd359833 ("media: staging/imx: Switch to v4l2_async_notifier_add_*_subdev")

from the v4l-dvb tree and commit:

  f93861c2d611 ("staging: Convert to using %pOFn instead of device_node.name")

from the staging tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/staging/media/imx/imx-media-dev.c
index 481840195071,3f48f5ceb6ea..000000000000
--- a/drivers/staging/media/imx/imx-media-dev.c
+++ b/drivers/staging/media/imx/imx-media-dev.c
@@@ -47,34 -80,52 +47,43 @@@ int imx_media_add_async_subdev(struct i
  	struct imx_media_async_subdev *imxasd;
  	struct v4l2_async_subdev *asd;
  	const char *devname = NULL;
 -	int ret = 0;
 -
 -	mutex_lock(&imxmd->mutex);
 +	int ret;
  
 -	if (pdev)
 +	if (fwnode) {
 +		asd = v4l2_async_notifier_add_fwnode_subdev(
 +			&imxmd->notifier, fwnode, sizeof(*imxasd));
 +	} else {
  		devname = dev_name(&pdev->dev);
 -
 -	/* return -EEXIST if this asd already added */
 -	if (find_async_subdev(imxmd, fwnode, devname)) {
 -		if (np)
 -			dev_dbg(imxmd->md.dev, "%s: already added %pOFn\n",
 -			__func__, np);
 -		else
 -			dev_dbg(imxmd->md.dev, "%s: already added %s\n",
 -			__func__, devname);
 -		ret = -EEXIST;
 -		goto out;
 +		asd = v4l2_async_notifier_add_devname_subdev(
 +			&imxmd->notifier, devname, sizeof(*imxasd));
  	}
  
 -	imxasd = devm_kzalloc(imxmd->md.dev, sizeof(*imxasd), GFP_KERNEL);
 -	if (!imxasd) {
 -		ret = -ENOMEM;
 -		goto out;
 +	if (IS_ERR(asd)) {
 +		ret = PTR_ERR(asd);
- 		if (ret == -EEXIST)
- 			dev_dbg(imxmd->md.dev, "%s: already added %s\n",
- 				__func__, np ? np->name : devname);
++		if (ret == -EEXIST) {
++			if (np)
++				dev_dbg(imxmd->md.dev, "%s: already added %pOFn\n",
++				__func__, np);
++			else
++				dev_dbg(imxmd->md.dev, "%s: already added %s\n",
++				__func__, devname);
++		}
 +		return ret;
  	}
 -	asd = &imxasd->asd;
  
 -	if (fwnode) {
 -		asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
 -		asd->match.fwnode = fwnode;
 +	imxasd = to_imx_media_asd(asd);
 +
 +	if (devname)
 +		imxasd->pdev = pdev;
 +
- 	dev_dbg(imxmd->md.dev, "%s: added %s, match type %s\n",
- 		__func__, np ? np->name : devname, np ? "FWNODE" : "DEVNAME");
++	if (fwnode)
+ 		dev_dbg(imxmd->md.dev, "%s: added %pOFn, match type FWNODE\n",
+ 			__func__, np);
 -	} else {
 -		asd->match_type = V4L2_ASYNC_MATCH_DEVNAME;
 -		asd->match.device_name = devname;
 -		imxasd->pdev = pdev;
++	else
+ 		dev_dbg(imxmd->md.dev, "%s: added %s, match type DEVNAME\n",
+ 			__func__, devname);
 -	}
 -
 -	list_add_tail(&imxasd->list, &imxmd->asd_list);
 -
 -	imxmd->subdev_notifier.num_subdevs++;
  
 -out:
 -	mutex_unlock(&imxmd->mutex);
 -	return ret;
 +	return 0;
  }
  
  /*