Skip to content

Commit 2b85207

Browse files
Heikki Krogerusgregkh
authored andcommitted
platform/x86: i2c-multi-instantiate: Derive the device name from parent
commit 24a8d78 upstream. When naming the new devices, instead of using the ACPI ID in the name as base, using the parent device's name. That makes it possible to support multiple multi-instance i2c devices of the same type in the same system. This fixes an issue seen on some Intel Kaby Lake based boards: sysfs: cannot create duplicate filename '/devices/pci0000:00/0000:00:15.0/i2c_designware.0/i2c-0/i2c-INT3515-tps6598x.0' Fixes: 2336dfa ("platform/x86: i2c-multi-instantiate: Allow to have same slaves") Cc: stable@vger.kernel.org Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b691516 commit 2b85207

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/platform/x86/i2c-multi-instantiate.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static int i2c_multi_inst_probe(struct platform_device *pdev)
9292
for (i = 0; i < multi->num_clients && inst_data[i].type; i++) {
9393
memset(&board_info, 0, sizeof(board_info));
9494
strlcpy(board_info.type, inst_data[i].type, I2C_NAME_SIZE);
95-
snprintf(name, sizeof(name), "%s-%s.%d", match->id,
95+
snprintf(name, sizeof(name), "%s-%s.%d", dev_name(dev),
9696
inst_data[i].type, i);
9797
board_info.dev_name = name;
9898
switch (inst_data[i].flags & IRQ_RESOURCE_TYPE) {

0 commit comments

Comments
 (0)