From: sashiko-bot@kernel.org
To: "Johan Hovold" <johan@kernel.org>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/panel-simple: take i2c adapter module reference
Date: Thu, 16 Jul 2026 13:49:00 +0000 [thread overview]
Message-ID: <20260716134901.05E221F00A3E@smtp.kernel.org> (raw)
In-Reply-To: <20260716132334.1565183-1-johan@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Calling `i2c_put_adapter()` breaks the build when `CONFIG_I2C` is not enabled.
--
--- Patch [1]: [PATCH] drm/panel-simple: take i2c adapter module reference ---
commit 78f8d3d7539288c8e1940d04e2aff6503a3592b4
Author: Johan Hovold <johan@kernel.org>
drm/panel-simple: take i2c adapter module reference
This patch changes the panel-simple driver to use of_get_i2c_adapter_by_node()
instead of of_find_i2c_adapter_by_node(). This ensures the i2c adapter module
reference is taken, preventing uninterruptible blocking during deregistration.
The teardown paths are updated to use i2c_put_adapter() instead of put_device().
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 5c169fdf265c1..79bd6bbec7bde 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
[ ... ]
> @@ -746,7 +746,7 @@ static struct panel_simple *panel_simple_probe(struct device *dev)
> pm_runtime_disable(dev);
> free_ddc:
> if (panel->ddc)
> - put_device(&panel->ddc->dev);
> + i2c_put_adapter(panel->ddc);
[Severity: Low]
Does this cause a build failure when CONFIG_I2C is disabled?
Looking at include/linux/i2c.h, it appears the declaration for i2c_put_adapter()
is guarded by IS_ENABLED(CONFIG_I2C), but there is no corresponding empty stub
provided in the fallback block for when I2C is disabled.
Since this driver can be built without CONFIG_I2C, calling i2c_put_adapter()
unconditionally here in panel_simple_probe() might result in an undefined
reference during linking or an implicit declaration error.
>
> return ERR_PTR(err);
> }
[ ... ]
> @@ -791,7 +791,7 @@ static void panel_simple_remove(struct device *dev)
> pm_runtime_dont_use_autosuspend(dev);
> pm_runtime_disable(dev);
> if (panel->ddc)
> - put_device(&panel->ddc->dev);
> + i2c_put_adapter(panel->ddc);
[Severity: Low]
The same potential build issue with CONFIG_I2C=n applies here in
panel_simple_remove().
> }
>
> static const struct drm_display_mode ampire_am_1280800n3tzqw_t00h_mode = {
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260716132334.1565183-1-johan@kernel.org?part=1
prev parent reply other threads:[~2026-07-16 13:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 13:23 [PATCH] drm/panel-simple: take i2c adapter module reference Johan Hovold
2026-07-16 13:49 ` sashiko-bot [this message]
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=20260716134901.05E221F00A3E@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=johan@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.