All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the devicetree tree with the i2c tree
@ 2014-11-26  4:33 Stephen Rothwell
  0 siblings, 0 replies; only message in thread
From: Stephen Rothwell @ 2014-11-26  4:33 UTC (permalink / raw
  To: Grant Likely, Wolfram Sang
  Cc: linux-next, linux-kernel, Pantelis Antoniou, Laurent Pinchart

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

Hi Grant,

Today's linux-next merge of the devicetree tree got a conflict in
drivers/i2c/i2c-core.c between commit 2fd36c552649 ("i2c: core: Map OF
IRQ at probe time") from the  i2c tree and commit a430a3455f2c
("i2c/of: Factor out Devicetree registration code") from the devicetree
tree.

I fixed it up (thanks for the heads up, but please see below) and can
carry the fix as necessary (no action is required).

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

diff --cc drivers/i2c/i2c-core.c
index 19800033e75d,d8afd3f28ca4..000000000000
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@@ -1380,61 -1369,69 +1381,67 @@@ static void i2c_scan_static_board_info(
  /* OF support code */
  
  #if IS_ENABLED(CONFIG_OF)
- static void of_i2c_register_devices(struct i2c_adapter *adap)
+ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
+ 						 struct device_node *node)
  {
- 	void *result;
- 	struct device_node *node;
+ 	struct i2c_client *result;
+ 	struct i2c_board_info info = {};
+ 	struct dev_archdata dev_ad = {};
+ 	const __be32 *addr;
+ 	int len;
  
- 	/* Only register child devices if the adapter has a node pointer set */
- 	if (!adap->dev.of_node)
- 		return;
+ 	dev_dbg(&adap->dev, "of_i2c: register %s\n", node->full_name);
  
- 	dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
+ 	if (of_modalias_node(node, info.type, sizeof(info.type)) < 0) {
+ 		dev_err(&adap->dev, "of_i2c: modalias failure on %s\n",
+ 			node->full_name);
+ 		return ERR_PTR(-EINVAL);
+ 	}
  
- 	for_each_available_child_of_node(adap->dev.of_node, node) {
- 		struct i2c_board_info info = {};
- 		struct dev_archdata dev_ad = {};
- 		const __be32 *addr;
- 		int len;
+ 	addr = of_get_property(node, "reg", &len);
+ 	if (!addr || (len < sizeof(int))) {
+ 		dev_err(&adap->dev, "of_i2c: invalid reg on %s\n",
+ 			node->full_name);
+ 		return ERR_PTR(-EINVAL);
+ 	}
  
- 		dev_dbg(&adap->dev, "of_i2c: register %s\n", node->full_name);
+ 	info.addr = be32_to_cpup(addr);
+ 	if (info.addr > (1 << 10) - 1) {
+ 		dev_err(&adap->dev, "of_i2c: invalid addr=%x on %s\n",
+ 			info.addr, node->full_name);
+ 		return ERR_PTR(-EINVAL);
+ 	}
  
- 		if (of_modalias_node(node, info.type, sizeof(info.type)) < 0) {
- 			dev_err(&adap->dev, "of_i2c: modalias failure on %s\n",
- 				node->full_name);
- 			continue;
- 		}
 -	info.irq = irq_of_parse_and_map(node, 0);
+ 	info.of_node = of_node_get(node);
+ 	info.archdata = &dev_ad;
  
- 		addr = of_get_property(node, "reg", &len);
- 		if (!addr || (len < sizeof(int))) {
- 			dev_err(&adap->dev, "of_i2c: invalid reg on %s\n",
- 				node->full_name);
- 			continue;
- 		}
+ 	if (of_get_property(node, "wakeup-source", NULL))
+ 		info.flags |= I2C_CLIENT_WAKE;
  
- 		info.addr = be32_to_cpup(addr);
- 		if (info.addr > (1 << 10) - 1) {
- 			dev_err(&adap->dev, "of_i2c: invalid addr=%x on %s\n",
- 				info.addr, node->full_name);
- 			continue;
- 		}
+ 	request_module("%s%s", I2C_MODULE_PREFIX, info.type);
  
- 		info.of_node = of_node_get(node);
- 		info.archdata = &dev_ad;
+ 	result = i2c_new_device(adap, &info);
+ 	if (result == NULL) {
+ 		dev_err(&adap->dev, "of_i2c: Failure registering %s\n",
+ 			node->full_name);
+ 		of_node_put(node);
 -		irq_dispose_mapping(info.irq);
+ 		return ERR_PTR(-EINVAL);
+ 	}
+ 	return result;
+ }
  
- 		if (of_get_property(node, "wakeup-source", NULL))
- 			info.flags |= I2C_CLIENT_WAKE;
+ static void of_i2c_register_devices(struct i2c_adapter *adap)
+ {
+ 	struct device_node *node;
  
- 		request_module("%s%s", I2C_MODULE_PREFIX, info.type);
+ 	/* Only register child devices if the adapter has a node pointer set */
+ 	if (!adap->dev.of_node)
+ 		return;
  
- 		result = i2c_new_device(adap, &info);
- 		if (result == NULL) {
- 			dev_err(&adap->dev, "of_i2c: Failure registering %s\n",
- 				node->full_name);
- 			of_node_put(node);
- 			continue;
- 		}
- 	}
+ 	dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
+ 
+ 	for_each_available_child_of_node(adap->dev.of_node, node)
+ 		of_i2c_register_device(adap, node);
  }
  
  static int of_dev_node_match(struct device *dev, void *data)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

only message in thread, other threads:[~2014-11-26  4:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-26  4:33 linux-next: manual merge of the devicetree tree with the i2c tree Stephen Rothwell

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.