From: Jean Delvare <jdelvare@suse.de>
To: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.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>,
Bartosz Golaszewski <brgl@kernel.org>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/6] i2c: piix4: use i2c_adapter_dev()
Date: Mon, 12 Jan 2026 10:44:49 +0100 [thread overview]
Message-ID: <20260112104449.26a4bf76@endymion> (raw)
In-Reply-To: <20251223-i2c-adapter-dev-wrapper-v1-2-bcf960a48fa9@oss.qualcomm.com>
Hi Bartosz,
On Tue, 23 Dec 2025 11:08:19 +0100, Bartosz Golaszewski wrote:
> Use i2c_adapter_dev() where applicable in order to avoid direct
> dereferencing of struct device embedded within struct i2c_adapter.
I will confess that I don't know what is wrong with the current way of
embedding struct device in a more specific device structure. I seem to
recall it was fairly standard to do things this way back when we
implemented this in the i2c subsystem. But I will trust you that this
change is needed now.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
> drivers/i2c/busses/i2c-piix4.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
> index ac3bb550303fe5893822af50c385004c9292e695..4fe0c49284646a9f2910939c98b51ee6777e8b52 100644
> --- a/drivers/i2c/busses/i2c-piix4.c
> +++ b/drivers/i2c/busses/i2c-piix4.c
> @@ -788,7 +788,7 @@ static s32 piix4_access_sb800(struct i2c_adapter *adap, u16 addr,
> u8 prev_port;
> int retval;
>
> - retval = piix4_sb800_region_request(&adap->dev, &adapdata->mmio_cfg);
> + retval = piix4_sb800_region_request(i2c_adapter_dev(adap), &adapdata->mmio_cfg);
> if (retval)
> return retval;
>
> @@ -859,7 +859,7 @@ static s32 piix4_access_sb800(struct i2c_adapter *adap, u16 addr,
> piix4_imc_wakeup();
>
> release:
> - piix4_sb800_region_release(&adap->dev, &adapdata->mmio_cfg);
> + piix4_sb800_region_release(i2c_adapter_dev(adap), &adapdata->mmio_cfg);
> return retval;
> }
>
> @@ -947,7 +947,7 @@ static int piix4_add_adapter(struct pci_dev *dev, unsigned short smba,
> adap->dev.parent = &dev->dev;
>
> if (has_acpi_companion(&dev->dev)) {
> - acpi_preset_companion(&adap->dev,
> + acpi_preset_companion(i2c_adapter_dev(adap),
> ACPI_COMPANION(&dev->dev),
> hw_port_nr);
> }
>
Acked-by: Jean Delvare <jdelvare@suse.de>
I see that you left one occurrence:
adap->dev.parent = &dev->dev;
I presume we'll need a wrapper for this construct as well?
Thanks,
--
Jean Delvare
SUSE L3 Support
next prev parent reply other threads:[~2026-01-12 9:44 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 ` [PATCH 1/6] i2c: provide i2c_adapter_dev() Bartosz Golaszewski
2025-12-23 10:08 ` [PATCH 2/6] i2c: piix4: use i2c_adapter_dev() Bartosz Golaszewski
2026-01-12 9:44 ` Jean Delvare [this message]
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=20260112104449.26a4bf76@endymion \
--to=jdelvare@suse.de \
--cc=andi.shyti@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=bin.du@amd.com \
--cc=brgl@kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=hanshu@zhaoxin.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