public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Vadim Pasternak <vadimp@nvidia.com>
To: <wsa@the-dreams.de>
Cc: <linux-i2c@vger.kernel.org>, Vadim Pasternak <vadimp@nvidia.com>
Subject: [PATCH i2c-next 1/1] i2c: mlxcpld: Add callback to notify probing completion
Date: Wed, 13 Jul 2022 12:11:36 +0300	[thread overview]
Message-ID: <20220713091136.734-1-vadimp@nvidia.com> (raw)

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(+)

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:
-- 
2.20.1


             reply	other threads:[~2022-07-13  9:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13  9:11 Vadim Pasternak [this message]
2022-07-16 12:51 ` [PATCH i2c-next 1/1] i2c: mlxcpld: Add callback to notify probing completion Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220713091136.734-1-vadimp@nvidia.com \
    --to=vadimp@nvidia.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox