diff options
author | Wolfram Sang <wsa@kernel.org> | 2021-04-10 22:48:34 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2021-04-10 22:48:34 +0300 |
commit | 2375843b50d6139b82648499daaad2034576905b (patch) | |
tree | 321fd890f3eeeda1f8ae38fef6312e6d959f5aba /drivers/i2c/i2c-core-base.c | |
parent | 660f58b6d290417828680f417f43d7b810fa9138 (diff) | |
parent | 4b2b4cc50ba6d607d1611ea6b2046a58d16e45eb (diff) | |
download | linux-2375843b50d6139b82648499daaad2034576905b.tar.xz |
Merge branch 'i2c/software-nodes' into i2c/for-5.13
Diffstat (limited to 'drivers/i2c/i2c-core-base.c')
-rw-r--r-- | drivers/i2c/i2c-core-base.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 15977add74bc..c81cc9a09877 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -909,11 +909,11 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf i2c_dev_set_name(adap, client, info); - if (info->properties) { - status = device_add_properties(&client->dev, info->properties); + if (info->swnode) { + status = device_add_software_node(&client->dev, info->swnode); if (status) { dev_err(&adap->dev, - "Failed to add properties to client %s: %d\n", + "Failed to add software node to client %s: %d\n", client->name, status); goto out_err_put_of_node; } @@ -921,16 +921,15 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf status = device_register(&client->dev); if (status) - goto out_free_props; + goto out_remove_swnode; dev_dbg(&adap->dev, "client [%s] registered with bus id %s\n", client->name, dev_name(&client->dev)); return client; -out_free_props: - if (info->properties) - device_remove_properties(&client->dev); +out_remove_swnode: + device_remove_software_node(&client->dev); out_err_put_of_node: of_node_put(info->of_node); out_err: @@ -960,6 +959,7 @@ void i2c_unregister_device(struct i2c_client *client) if (ACPI_COMPANION(&client->dev)) acpi_device_clear_enumerated(ACPI_COMPANION(&client->dev)); + device_remove_software_node(&client->dev); device_unregister(&client->dev); } EXPORT_SYMBOL_GPL(i2c_unregister_device); |