Skip to content

Commit b0ddda5

Browse files
abdurrahman-nexthopgroeck
authored andcommitted
hwmon: (pmbus/adm1266) include adapter number in GPIO line label
Platforms that fit more than one ADM1266 on different I2C buses at the same 7-bit slave address (a common shelf-management pattern, e.g. one device per power domain) end up with duplicate GPIO line labels because the existing format only includes the slave address. Including the adapter number disambiguates them. The adapter number is formatted as decimal to match the i2c-N convention used elsewhere in Linux (sysfs paths, dev nodes); the slave address keeps its conventional hexadecimal form. The label is purely informational (visible via gpioinfo and the gpiochip /sys/class/gpio name); no DT or ABI consumer parses it. Fixes: d98dfad ("hwmon: (pmbus/adm1266) Add support for GPIOs") Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai> Link: https://lore.kernel.org/r/20260512-adm1266-v3-5-a81a479b0bb0@nexthop.ai Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 487566c commit b0ddda5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/hwmon/pmbus/adm1266.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,9 @@ static int adm1266_config_gpio(struct adm1266_data *data)
291291
int i;
292292

293293
for (i = 0; i < ARRAY_SIZE(data->gpio_names); i++) {
294-
gpio_name = devm_kasprintf(&data->client->dev, GFP_KERNEL, "adm1266-%x-%s",
295-
data->client->addr, adm1266_names[i]);
294+
gpio_name = devm_kasprintf(&data->client->dev, GFP_KERNEL, "adm1266-%d-%x-%s",
295+
data->client->adapter->nr, data->client->addr,
296+
adm1266_names[i]);
296297
if (!gpio_name)
297298
return -ENOMEM;
298299

0 commit comments

Comments
 (0)