Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i2c: xiic: use numbered adapter registration

Switch from i2c_add_adapter() to i2c_add_numbered_adapter() to enable
platforms to specify fixed I2C bus numbers via the platform device ID.

This allows systems to maintain consistent bus numbering across reboots.
On platforms where the device ID is PLATFORM_DEVID_NONE (the default),
the adapter falls back to dynamic allocation, preserving backward
compatibility.

Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260223-i2c-xiic-v12-6-b6c9ce4e4f3c@nexthop.ai

authored by

Abdurrahman Hussain and committed by
Andi Shyti
91430a8e f715b059

+2 -1
+2 -1
drivers/i2c/busses/i2c-xiic.c
··· 1451 1451 /* hook up driver to tree */ 1452 1452 platform_set_drvdata(pdev, i2c); 1453 1453 i2c->adap = xiic_adapter; 1454 + i2c->adap.nr = pdev->id; 1454 1455 i2c_set_adapdata(&i2c->adap, i2c); 1455 1456 i2c->adap.dev.parent = &pdev->dev; 1456 1457 device_set_node(&i2c->adap.dev, fwnode); ··· 1508 1507 return dev_err_probe(dev, ret, "Cannot xiic_reinit\n"); 1509 1508 1510 1509 /* add i2c adapter to i2c tree */ 1511 - ret = i2c_add_adapter(&i2c->adap); 1510 + ret = i2c_add_numbered_adapter(&i2c->adap); 1512 1511 if (ret) { 1513 1512 xiic_deinit(i2c); 1514 1513 return ret;