diff options
Diffstat (limited to 'drivers/i2c/i2c-core-base.c')
-rw-r--r-- | drivers/i2c/i2c-core-base.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index a17f46a95f73..31d16ada6e7d 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c | |||
@@ -717,10 +717,6 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info) | |||
717 | client->adapter = adap; | 717 | client->adapter = adap; |
718 | 718 | ||
719 | client->dev.platform_data = info->platform_data; | 719 | client->dev.platform_data = info->platform_data; |
720 | |||
721 | if (info->archdata) | ||
722 | client->dev.archdata = *info->archdata; | ||
723 | |||
724 | client->flags = info->flags; | 720 | client->flags = info->flags; |
725 | client->addr = info->addr; | 721 | client->addr = info->addr; |
726 | 722 | ||
@@ -746,7 +742,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info) | |||
746 | client->dev.parent = &client->adapter->dev; | 742 | client->dev.parent = &client->adapter->dev; |
747 | client->dev.bus = &i2c_bus_type; | 743 | client->dev.bus = &i2c_bus_type; |
748 | client->dev.type = &i2c_client_type; | 744 | client->dev.type = &i2c_client_type; |
749 | client->dev.of_node = info->of_node; | 745 | client->dev.of_node = of_node_get(info->of_node); |
750 | client->dev.fwnode = info->fwnode; | 746 | client->dev.fwnode = info->fwnode; |
751 | 747 | ||
752 | i2c_dev_set_name(adap, client, info); | 748 | i2c_dev_set_name(adap, client, info); |
@@ -757,7 +753,7 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info) | |||
757 | dev_err(&adap->dev, | 753 | dev_err(&adap->dev, |
758 | "Failed to add properties to client %s: %d\n", | 754 | "Failed to add properties to client %s: %d\n", |
759 | client->name, status); | 755 | client->name, status); |
760 | goto out_err; | 756 | goto out_err_put_of_node; |
761 | } | 757 | } |
762 | } | 758 | } |
763 | 759 | ||
@@ -773,6 +769,8 @@ i2c_new_device(struct i2c_adapter *adap, struct i2c_board_info const *info) | |||
773 | out_free_props: | 769 | out_free_props: |
774 | if (info->properties) | 770 | if (info->properties) |
775 | device_remove_properties(&client->dev); | 771 | device_remove_properties(&client->dev); |
772 | out_err_put_of_node: | ||
773 | of_node_put(info->of_node); | ||
776 | out_err: | 774 | out_err: |
777 | dev_err(&adap->dev, | 775 | dev_err(&adap->dev, |
778 | "Failed to register i2c client %s at 0x%02x (%d)\n", | 776 | "Failed to register i2c client %s at 0x%02x (%d)\n", |