mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Jean Delvare <jdelvare@suse.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	Shyam Sundar S K <shyam-sundar.s-k@amd.com>,
	Nirujogi Pratap <pratap.nirujogi@amd.com>,
	Bin Du <bin.du@amd.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jan Dabros <jsd@semihalf.com>,
	Gregory CLEMENT <gregory.clement@bootlin.com>,
	Hans Hu <hanshu@zhaoxin.com>
Cc: Bartosz Golaszewski <brgl@kernel.org>,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Subject: [PATCH 1/6] i2c: provide i2c_adapter_dev()
Date: Tue, 23 Dec 2025 11:08:18 +0100	[thread overview]
Message-ID: <20251223-i2c-adapter-dev-wrapper-v1-1-bcf960a48fa9@oss.qualcomm.com> (raw)
In-Reply-To: <20251223-i2c-adapter-dev-wrapper-v1-0-bcf960a48fa9@oss.qualcomm.com>

Provide a wrapper around the dereferencing of i2c_adapter::dev. Once we
convert i2c drivers to using it, it will be possible to finally move the
embedded struct device into a separate, revocable structure protected by
SRCU.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 include/linux/i2c.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 20fd41b51d5c85ee1665395c07345faafd8e2fca..b5f4db9417aca2e058c8be19d57d693339b6f9b9 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -768,6 +768,11 @@ struct i2c_adapter {
 };
 #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
 
+static inline struct device *i2c_adapter_dev(struct i2c_adapter *adap)
+{
+	return &adap->dev;
+}
+
 static inline void *i2c_get_adapdata(const struct i2c_adapter *adap)
 {
 	return dev_get_drvdata(&adap->dev);

-- 
2.47.3


  reply	other threads:[~2025-12-23 10:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23 10:08 [PATCH 0/6] i2c: provide and use i2c_adapter_dev() Bartosz Golaszewski
2025-12-23 10:08 ` Bartosz Golaszewski [this message]
2025-12-23 10:08 ` [PATCH 2/6] i2c: piix4: " Bartosz Golaszewski
2026-01-12  9:44   ` Jean Delvare
2026-01-13 10:24     ` Wolfram Sang
2025-12-23 10:08 ` [PATCH 3/6] i2c: amd-asf-plat: " Bartosz Golaszewski
2025-12-23 11:21   ` Shyam Sundar S K
2025-12-23 10:08 ` [PATCH 4/6] i2c: designware-amdisp: " Bartosz Golaszewski
2025-12-27 14:29   ` Andy Shevchenko
2025-12-27 14:30     ` Andy Shevchenko
2026-01-05 19:26   ` Nirujogi, Pratap
2026-01-05 21:42     ` Andy Shevchenko
2025-12-23 10:08 ` [PATCH 5/6] i2c: mv64xxx: " Bartosz Golaszewski
2026-01-05 13:51   ` Gregory CLEMENT
2025-12-23 10:08 ` [PATCH 6/6] i2c: viai2c-zhaoxin: " Bartosz Golaszewski
2025-12-27 14:31   ` Andy Shevchenko

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=20251223-i2c-adapter-dev-wrapper-v1-1-bcf960a48fa9@oss.qualcomm.com \
    --to=bartosz.golaszewski@oss.qualcomm.com \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bin.du@amd.com \
    --cc=brgl@kernel.org \
    --cc=gregory.clement@bootlin.com \
    --cc=hanshu@zhaoxin.com \
    --cc=jdelvare@suse.com \
    --cc=jsd@semihalf.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=pratap.nirujogi@amd.com \
    --cc=shyam-sundar.s-k@amd.com \
    --cc=wsa+renesas@sang-engineering.com \
    /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

all inboxes | Powered by JetHome®