diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-11-28 13:45:33 +0200 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2018-12-03 21:40:02 +0200 |
commit | 2336dfadfb1e3a484f0daf4014305626a3d9df62 (patch) | |
tree | 9a2da2a453e4920eb189062f1e6989256ccbac74 /drivers/platform/x86/i2c-multi-instantiate.c | |
parent | 799d3379a6728794de5ed2be8acc5b4a65d776b6 (diff) | |
download | lwn-2336dfadfb1e3a484f0daf4014305626a3d9df62.tar.gz lwn-2336dfadfb1e3a484f0daf4014305626a3d9df62.zip |
platform/x86: i2c-multi-instantiate: Allow to have same slaves
Currently the driver will not enumerate the devices where I2C slaves
are of the same type.
Add an instance number to make them unique.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/i2c-multi-instantiate.c')
-rw-r--r-- | drivers/platform/x86/i2c-multi-instantiate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c index 365457f9c424..2439d4c71118 100644 --- a/drivers/platform/x86/i2c-multi-instantiate.c +++ b/drivers/platform/x86/i2c-multi-instantiate.c @@ -92,8 +92,8 @@ static int i2c_multi_inst_probe(struct platform_device *pdev) for (i = 0; i < multi->num_clients && inst_data[i].type; i++) { memset(&board_info, 0, sizeof(board_info)); strlcpy(board_info.type, inst_data[i].type, I2C_NAME_SIZE); - snprintf(name, sizeof(name), "%s-%s", match->id, - inst_data[i].type); + snprintf(name, sizeof(name), "%s-%s.%d", match->id, + inst_data[i].type, i); board_info.dev_name = name; switch (inst_data[i].flags & IRQ_RESOURCE_TYPE) { case IRQ_RESOURCE_GPIO: |