diff mbox series

[i2c-next,1/1] i2c: mlxcpld: Add callback to notify probing completion

Message ID 20220713091136.734-1-vadimp@nvidia.com
State Accepted
Headers show
Series [i2c-next,1/1] i2c: mlxcpld: Add callback to notify probing completion | expand

Commit Message

Vadim Pasternak July 13, 2022, 9:11 a.m. UTC
Add notification to inform caller that driver probing has been
completed. It allows to user, invoked platform device registration for
"i2c-mlxcpld" driver, to be notified that bus adapter is available, and
thus some devices could be connected to this bus.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
---
 drivers/i2c/busses/i2c-mlxcpld.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Wolfram Sang July 16, 2022, 12:51 p.m. UTC | #1
On Wed, Jul 13, 2022 at 12:11:36PM +0300, Vadim Pasternak wrote:
> Add notification to inform caller that driver probing has been
> completed. It allows to user, invoked platform device registration for
> "i2c-mlxcpld" driver, to be notified that bus adapter is available, and
> thus some devices could be connected to this bus.
> 
> Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>

Applied to for-next, thanks!
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c
index 56aa424fd71d..363ea9fd66c4 100644
--- a/drivers/i2c/busses/i2c-mlxcpld.c
+++ b/drivers/i2c/busses/i2c-mlxcpld.c
@@ -560,6 +560,10 @@  static int mlxcpld_i2c_probe(struct platform_device *pdev)
 	if (err)
 		goto mlxcpld_i2_probe_failed;
 
+	/* Notify caller when adapter is added. */
+	if (pdata && pdata->completion_notify)
+		pdata->completion_notify(pdata->handle, mlxcpld_i2c_adapter.nr);
+
 	return 0;
 
 mlxcpld_i2_probe_failed: