diff options
Diffstat (limited to 'drivers/i2c/i2c-core-of.c')
| -rw-r--r-- | drivers/i2c/i2c-core-of.c | 9 | 
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c index bce6b796e04c..a6c407d36800 100644 --- a/drivers/i2c/i2c-core-of.c +++ b/drivers/i2c/i2c-core-of.c @@ -27,7 +27,7 @@ int of_i2c_get_board_info(struct device *dev, struct device_node *node,  	memset(info, 0, sizeof(*info)); -	if (of_modalias_node(node, info->type, sizeof(info->type)) < 0) { +	if (of_alias_from_compatible(node, info->type, sizeof(info->type)) < 0) {  		dev_err(dev, "of_i2c: modalias failure on %pOF\n", node);  		return -EINVAL;  	} @@ -55,7 +55,7 @@ int of_i2c_get_board_info(struct device *dev, struct device_node *node,  	if (of_property_read_bool(node, "host-notify"))  		info->flags |= I2C_CLIENT_HOST_NOTIFY; -	if (of_get_property(node, "wakeup-source", NULL)) +	if (of_property_read_bool(node, "wakeup-source"))  		info->flags |= I2C_CLIENT_WAKE;  	return 0; @@ -178,6 +178,11 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,  			return NOTIFY_OK;  		} +		/* +		 * Clear the flag before adding the device so that fw_devlink +		 * doesn't skip adding consumers to this device. +		 */ +		rd->dn->fwnode.flags &= ~FWNODE_FLAG_NOT_DEVICE;  		client = of_i2c_register_device(adap, rd->dn);  		if (IS_ERR(client)) {  			dev_err(&adap->dev, "failed to create client for '%pOF'\n",  |