i2c-for-6.14-rc1-take2

Fixes two issues introduced with the first pull request:
 
 - add a missing Kconfig dependency for imx-lpi2c
 - in the core, handle the new per-client debugfs directory during
   probe/remove, not during {un}register
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmeb8RoACgkQFA3kzBSg
 KbYvIhAAoGqv4VnuVF/QMSiVVbC0LFMXI7DOPv0zgeF/ng7gVj/vo9pDD3Hgpiom
 7dA2KuBF2DU0CndUtdqkb1H2nnUcFsDad+nD/QCV2zN8nIVYNtatTXBijZzyO808
 PqWgKTmESoEm1DKWMRzuA8pmEwTCTaejrM2r5EBFBiqIyc+oIrcYUYsi8/uBWL5E
 v+6u4tztC/aLu6dawJK0jLA7tqnyck8nJaMirXJ37WXxPm4DV7A/kUHg89se7QBH
 ++VI7flOu4tMFHqJeOeHPGlxv80ZRi0QZZbe41AdYV94RkAydWstrRX6N8UD37GE
 zTEwHqgLekSa/7xjGqHMqwtJVBC8j5fTEfFUuL3tz0ucnPDueVT+NwmNAZdMJtje
 CpW6LxEWE9Za6xASA/NhtqtQLwN2tltvNFr4BIVcIt4iNy+/lBHtLExbdJgdyudM
 ORXGCOXh2C9o1S/I3q9hrjlROnOPUHJhMAoRJ0sDtXgMP4G58D0/NfLrltiw6+UH
 VkR03KTVdKYlO7MeHXB6idn4s/eOTHl1a4hGLQc2KHygmeXTwtnN0bsp7FPDyReC
 ZN4B7uHMXPJ1QJTGJ+wB1I27Bahee1Ni9zhzq6EFG7KJhbmF4h9rkDHz517zX8+H
 5hCTCpgkje/xhF6G4QZjND0NSfAEC54vUNpVLMy75b++LnbdKjE=
 =iPD9
 -----END PGP SIGNATURE-----

Merge tag 'i2c-for-6.14-rc1-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:

 - add a missing Kconfig dependency for imx-lpi2c

 - in the core, handle the new per-client debugfs directory during
   probe/remove, not during {un}register

* tag 'i2c-for-6.14-rc1-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
  i2c: Fix core-managed per-client debugfs handling
  i2c: imx-lpi2c: select CONFIG_I2C_SLAVE
This commit is contained in:
Linus Torvalds 2025-01-30 17:43:36 -08:00
commit a4b5e48ec4
2 changed files with 7 additions and 3 deletions

View File

@ -756,6 +756,7 @@ config I2C_IMX
config I2C_IMX_LPI2C
tristate "IMX Low Power I2C interface"
depends on ARCH_MXC || COMPILE_TEST
select I2C_SLAVE
help
Say Y here if you want to use the Low Power IIC bus controller
on the Freescale i.MX processors.

View File

@ -583,6 +583,9 @@ static int i2c_device_probe(struct device *dev)
goto err_detach_pm_domain;
}
client->debugfs = debugfs_create_dir(dev_name(&client->dev),
client->adapter->debugfs);
if (driver->probe)
status = driver->probe(client);
else
@ -602,6 +605,7 @@ static int i2c_device_probe(struct device *dev)
return 0;
err_release_driver_resources:
debugfs_remove_recursive(client->debugfs);
devres_release_group(&client->dev, client->devres_group_id);
err_detach_pm_domain:
dev_pm_domain_detach(&client->dev, do_power_on);
@ -627,6 +631,8 @@ static void i2c_device_remove(struct device *dev)
driver->remove(client);
}
debugfs_remove_recursive(client->debugfs);
devres_release_group(&client->dev, client->devres_group_id);
dev_pm_domain_detach(&client->dev, true);
@ -1015,8 +1021,6 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf
if (status)
goto out_remove_swnode;
client->debugfs = debugfs_create_dir(dev_name(&client->dev), adap->debugfs);
dev_dbg(&adap->dev, "client [%s] registered with bus id %s\n",
client->name, dev_name(&client->dev));
@ -1061,7 +1065,6 @@ void i2c_unregister_device(struct i2c_client *client)
if (ACPI_COMPANION(&client->dev))
acpi_device_clear_enumerated(ACPI_COMPANION(&client->dev));
debugfs_remove_recursive(client->debugfs);
device_remove_software_node(&client->dev);
device_unregister(&client->dev);
}