From: Vadim Pasternak Date: Wed, 13 Jul 2022 09:11:36 +0000 (+0300) Subject: i2c: mlxcpld: Add callback to notify probing completion X-Git-Tag: v6.0-rc1~140^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f438d2318f4b8012b3153130cf6b0259c76c8d6;p=thirdparty%2Fkernel%2Flinux.git i2c: mlxcpld: Add callback to notify probing completion 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 Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-mlxcpld.c b/drivers/i2c/busses/i2c-mlxcpld.c index 56aa424fd71d5..363ea9fd66c47 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: