Re: [PATCH 4/4] ti-vpe: Parse local endpoint for properties, not the remote one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sakari,

I love your patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v5.0 next-20190306]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Sakari-Ailus/V4L2-fwnode-framework-and-driver-fixes/20190308-042715
base:   git://linuxtv.org/media_tree.git master
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=8.2.0 make.cross ARCH=sparc64 

All errors (new ones prefixed by >>):

   drivers/media//platform/ti-vpe/cal.c: In function 'of_cal_create_instance':
>> drivers/media//platform/ti-vpe/cal.c:1755:14: error: 'remote_ep' undeclared (first use in this function)
     of_node_put(remote_ep);
                 ^~~~~~~~~
   drivers/media//platform/ti-vpe/cal.c:1755:14: note: each undeclared identifier is reported only once for each function it appears in

vim +/remote_ep +1755 drivers/media//platform/ti-vpe/cal.c

343e89a79 Benoit Parrot         2016-01-06  1642  
343e89a79 Benoit Parrot         2016-01-06  1643  static int of_cal_create_instance(struct cal_ctx *ctx, int inst)
343e89a79 Benoit Parrot         2016-01-06  1644  {
343e89a79 Benoit Parrot         2016-01-06  1645  	struct platform_device *pdev = ctx->dev->pdev;
e8013a352 Sakari Ailus          2019-03-05  1646  	struct device_node *ep_node, *port, *sensor_node, *parent;
859969b38 Sakari Ailus          2016-08-26  1647  	struct v4l2_fwnode_endpoint *endpoint;
343e89a79 Benoit Parrot         2016-01-06  1648  	struct v4l2_async_subdev *asd;
343e89a79 Benoit Parrot         2016-01-06  1649  	u32 regval = 0;
343e89a79 Benoit Parrot         2016-01-06  1650  	int ret, index, found_port = 0, lane;
343e89a79 Benoit Parrot         2016-01-06  1651  
343e89a79 Benoit Parrot         2016-01-06  1652  	parent = pdev->dev.of_node;
343e89a79 Benoit Parrot         2016-01-06  1653  
343e89a79 Benoit Parrot         2016-01-06  1654  	asd = &ctx->asd;
343e89a79 Benoit Parrot         2016-01-06  1655  	endpoint = &ctx->endpoint;
343e89a79 Benoit Parrot         2016-01-06  1656  
343e89a79 Benoit Parrot         2016-01-06  1657  	ep_node = NULL;
343e89a79 Benoit Parrot         2016-01-06  1658  	port = NULL;
343e89a79 Benoit Parrot         2016-01-06  1659  	sensor_node = NULL;
343e89a79 Benoit Parrot         2016-01-06  1660  	ret = -EINVAL;
343e89a79 Benoit Parrot         2016-01-06  1661  
343e89a79 Benoit Parrot         2016-01-06  1662  	ctx_dbg(3, ctx, "Scanning Port node for csi2 port: %d\n", inst);
343e89a79 Benoit Parrot         2016-01-06  1663  	for (index = 0; index < CAL_NUM_CSI2_PORTS; index++) {
343e89a79 Benoit Parrot         2016-01-06  1664  		port = of_get_next_port(parent, port);
343e89a79 Benoit Parrot         2016-01-06  1665  		if (!port) {
343e89a79 Benoit Parrot         2016-01-06  1666  			ctx_dbg(1, ctx, "No port node found for csi2 port:%d\n",
343e89a79 Benoit Parrot         2016-01-06  1667  				index);
343e89a79 Benoit Parrot         2016-01-06  1668  			goto cleanup_exit;
343e89a79 Benoit Parrot         2016-01-06  1669  		}
343e89a79 Benoit Parrot         2016-01-06  1670  
343e89a79 Benoit Parrot         2016-01-06  1671  		/* Match the slice number with <REG> */
343e89a79 Benoit Parrot         2016-01-06  1672  		of_property_read_u32(port, "reg", &regval);
343e89a79 Benoit Parrot         2016-01-06  1673  		ctx_dbg(3, ctx, "port:%d inst:%d <reg>:%d\n",
343e89a79 Benoit Parrot         2016-01-06  1674  			index, inst, regval);
343e89a79 Benoit Parrot         2016-01-06  1675  		if ((regval == inst) && (index == inst)) {
343e89a79 Benoit Parrot         2016-01-06  1676  			found_port = 1;
343e89a79 Benoit Parrot         2016-01-06  1677  			break;
343e89a79 Benoit Parrot         2016-01-06  1678  		}
343e89a79 Benoit Parrot         2016-01-06  1679  	}
343e89a79 Benoit Parrot         2016-01-06  1680  
343e89a79 Benoit Parrot         2016-01-06  1681  	if (!found_port) {
343e89a79 Benoit Parrot         2016-01-06  1682  		ctx_dbg(1, ctx, "No port node matches csi2 port:%d\n",
343e89a79 Benoit Parrot         2016-01-06  1683  			inst);
343e89a79 Benoit Parrot         2016-01-06  1684  		goto cleanup_exit;
343e89a79 Benoit Parrot         2016-01-06  1685  	}
343e89a79 Benoit Parrot         2016-01-06  1686  
343e89a79 Benoit Parrot         2016-01-06  1687  	ctx_dbg(3, ctx, "Scanning sub-device for csi2 port: %d\n",
343e89a79 Benoit Parrot         2016-01-06  1688  		inst);
343e89a79 Benoit Parrot         2016-01-06  1689  
343e89a79 Benoit Parrot         2016-01-06  1690  	ep_node = of_get_next_endpoint(port, ep_node);
343e89a79 Benoit Parrot         2016-01-06  1691  	if (!ep_node) {
343e89a79 Benoit Parrot         2016-01-06  1692  		ctx_dbg(3, ctx, "can't get next endpoint\n");
343e89a79 Benoit Parrot         2016-01-06  1693  		goto cleanup_exit;
343e89a79 Benoit Parrot         2016-01-06  1694  	}
343e89a79 Benoit Parrot         2016-01-06  1695  
343e89a79 Benoit Parrot         2016-01-06  1696  	sensor_node = of_graph_get_remote_port_parent(ep_node);
343e89a79 Benoit Parrot         2016-01-06  1697  	if (!sensor_node) {
343e89a79 Benoit Parrot         2016-01-06  1698  		ctx_dbg(3, ctx, "can't get remote parent\n");
343e89a79 Benoit Parrot         2016-01-06  1699  		goto cleanup_exit;
343e89a79 Benoit Parrot         2016-01-06  1700  	}
859969b38 Sakari Ailus          2016-08-26  1701  	asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
4e48afecd Mauro Carvalho Chehab 2017-09-27  1702  	asd->match.fwnode = of_fwnode_handle(sensor_node);
343e89a79 Benoit Parrot         2016-01-06  1703  
e8013a352 Sakari Ailus          2019-03-05  1704  	v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep_node), endpoint);
343e89a79 Benoit Parrot         2016-01-06  1705  
2d95e7ed0 Sakari Ailus          2018-07-03  1706  	if (endpoint->bus_type != V4L2_MBUS_CSI2_DPHY) {
f764e6d68 Rob Herring           2018-08-27  1707  		ctx_err(ctx, "Port:%d sub-device %pOFn is not a CSI2 device\n",
f764e6d68 Rob Herring           2018-08-27  1708  			inst, sensor_node);
343e89a79 Benoit Parrot         2016-01-06  1709  		goto cleanup_exit;
343e89a79 Benoit Parrot         2016-01-06  1710  	}
343e89a79 Benoit Parrot         2016-01-06  1711  
343e89a79 Benoit Parrot         2016-01-06  1712  	/* Store Virtual Channel number */
343e89a79 Benoit Parrot         2016-01-06  1713  	ctx->virtual_channel = endpoint->base.id;
343e89a79 Benoit Parrot         2016-01-06  1714  
343e89a79 Benoit Parrot         2016-01-06  1715  	ctx_dbg(3, ctx, "Port:%d v4l2-endpoint: CSI2\n", inst);
343e89a79 Benoit Parrot         2016-01-06  1716  	ctx_dbg(3, ctx, "Virtual Channel=%d\n", ctx->virtual_channel);
343e89a79 Benoit Parrot         2016-01-06  1717  	ctx_dbg(3, ctx, "flags=0x%08x\n", endpoint->bus.mipi_csi2.flags);
343e89a79 Benoit Parrot         2016-01-06  1718  	ctx_dbg(3, ctx, "clock_lane=%d\n", endpoint->bus.mipi_csi2.clock_lane);
343e89a79 Benoit Parrot         2016-01-06  1719  	ctx_dbg(3, ctx, "num_data_lanes=%d\n",
343e89a79 Benoit Parrot         2016-01-06  1720  		endpoint->bus.mipi_csi2.num_data_lanes);
343e89a79 Benoit Parrot         2016-01-06  1721  	ctx_dbg(3, ctx, "data_lanes= <\n");
343e89a79 Benoit Parrot         2016-01-06  1722  	for (lane = 0; lane < endpoint->bus.mipi_csi2.num_data_lanes; lane++)
343e89a79 Benoit Parrot         2016-01-06  1723  		ctx_dbg(3, ctx, "\t%d\n",
343e89a79 Benoit Parrot         2016-01-06  1724  			endpoint->bus.mipi_csi2.data_lanes[lane]);
343e89a79 Benoit Parrot         2016-01-06  1725  	ctx_dbg(3, ctx, "\t>\n");
343e89a79 Benoit Parrot         2016-01-06  1726  
f764e6d68 Rob Herring           2018-08-27  1727  	ctx_dbg(1, ctx, "Port: %d found sub-device %pOFn\n",
f764e6d68 Rob Herring           2018-08-27  1728  		inst, sensor_node);
343e89a79 Benoit Parrot         2016-01-06  1729  
d079f94c9 Steve Longerbeam      2018-09-29  1730  	v4l2_async_notifier_init(&ctx->notifier);
d079f94c9 Steve Longerbeam      2018-09-29  1731  
d079f94c9 Steve Longerbeam      2018-09-29  1732  	ret = v4l2_async_notifier_add_subdev(&ctx->notifier, asd);
d079f94c9 Steve Longerbeam      2018-09-29  1733  	if (ret) {
d079f94c9 Steve Longerbeam      2018-09-29  1734  		ctx_err(ctx, "Error adding asd\n");
d079f94c9 Steve Longerbeam      2018-09-29  1735  		goto cleanup_exit;
d079f94c9 Steve Longerbeam      2018-09-29  1736  	}
d079f94c9 Steve Longerbeam      2018-09-29  1737  
b6ee3f0dc Laurent Pinchart      2017-08-30  1738  	ctx->notifier.ops = &cal_async_ops;
343e89a79 Benoit Parrot         2016-01-06  1739  	ret = v4l2_async_notifier_register(&ctx->v4l2_dev,
343e89a79 Benoit Parrot         2016-01-06  1740  					   &ctx->notifier);
343e89a79 Benoit Parrot         2016-01-06  1741  	if (ret) {
343e89a79 Benoit Parrot         2016-01-06  1742  		ctx_err(ctx, "Error registering async notifier\n");
d079f94c9 Steve Longerbeam      2018-09-29  1743  		v4l2_async_notifier_cleanup(&ctx->notifier);
343e89a79 Benoit Parrot         2016-01-06  1744  		ret = -EINVAL;
343e89a79 Benoit Parrot         2016-01-06  1745  	}
343e89a79 Benoit Parrot         2016-01-06  1746  
d079f94c9 Steve Longerbeam      2018-09-29  1747  	/*
d079f94c9 Steve Longerbeam      2018-09-29  1748  	 * On success we need to keep reference on sensor_node, or
d079f94c9 Steve Longerbeam      2018-09-29  1749  	 * if notifier_cleanup was called above, sensor_node was
d079f94c9 Steve Longerbeam      2018-09-29  1750  	 * already put.
d079f94c9 Steve Longerbeam      2018-09-29  1751  	 */
d079f94c9 Steve Longerbeam      2018-09-29  1752  	sensor_node = NULL;
d079f94c9 Steve Longerbeam      2018-09-29  1753  
343e89a79 Benoit Parrot         2016-01-06  1754  cleanup_exit:
343e89a79 Benoit Parrot         2016-01-06 @1755  	of_node_put(remote_ep);
343e89a79 Benoit Parrot         2016-01-06  1756  	of_node_put(sensor_node);
343e89a79 Benoit Parrot         2016-01-06  1757  	of_node_put(ep_node);
343e89a79 Benoit Parrot         2016-01-06  1758  	of_node_put(port);
343e89a79 Benoit Parrot         2016-01-06  1759  
343e89a79 Benoit Parrot         2016-01-06  1760  	return ret;
343e89a79 Benoit Parrot         2016-01-06  1761  }
343e89a79 Benoit Parrot         2016-01-06  1762  

:::::: The code at line 1755 was first introduced by commit
:::::: 343e89a792a571b28b9c02850db7af2ef25ffb20 [media] media: ti-vpe: Add CAL v4l2 camera capture driver

:::::: TO: Benoit Parrot <bparrot@xxxxxx>
:::::: CC: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux