From d08ed10623b3cba46102cd3d569a7517cbf48e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Tue, 25 Jun 2024 10:31:31 +0200 Subject: i2c: Drop explicit initialization of struct i2c_device_id::driver_data to 0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These drivers don't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. While add it, also remove a comma after the sentinel entry. Signed-off-by: Uwe Kleine-König Signed-off-by: Wolfram Sang --- drivers/i2c/i2c-core-base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/i2c/i2c-core-base.c') diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index db0d1ac82910..49fdcb3eb8f6 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1066,8 +1066,8 @@ EXPORT_SYMBOL(i2c_find_device_by_fwnode); static const struct i2c_device_id dummy_id[] = { - { "dummy", 0 }, - { }, + { "dummy" }, + { } }; static int dummy_probe(struct i2c_client *client) -- cgit v1.2.3 From 500c20fe3ea4a241f7ea58a414343367ab2e4085 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Thu, 4 Jul 2024 05:28:59 +0200 Subject: i2c: add debug message for detected HostNotify alerts Setting up HostNotify can be tricky. Support debugging by stating when a HostNotify alert was received independent of the irq being mapped. Especially useful with the in-kernel i2c testunit. Update documentation as well. Signed-off-by: Wolfram Sang Reviewed-by: Andi Shyti --- drivers/i2c/i2c-core-base.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/i2c/i2c-core-base.c') diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 49fdcb3eb8f6..a5fce479ab13 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1468,6 +1468,8 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr) if (!adap) return -EINVAL; + dev_dbg(&adap->dev, "Detected HostNotify from address 0x%02x", addr); + irq = irq_find_mapping(adap->host_notify_domain, addr); if (irq <= 0) return -ENXIO; -- cgit v1.2.3