Skip to content

Commit

Permalink
platform/x86: i2c-multi-instantiate: Allow to have same slaves
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Shevchenko committed Dec 3, 2018
1 parent 799d337 commit 2336dfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/platform/x86/i2c-multi-instantiate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2336dfa

Please sign in to comment.