From: sashiko-bot@kernel.org
To: "Yu-Chun Lin" <eleanor.lin@realtek.com>
Cc: robh@kernel.org, krzk+dt@kernel.org, devicetree@vger.kernel.org,
conor+dt@kernel.org
Subject: Re: [PATCH v7 03/10] clk: realtek: Introduce a common probe()
Date: Fri, 08 May 2026 21:24:25 +0000 [thread overview]
Message-ID: <20260508212425.DD28BC2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260508111641.3192177-4-eleanor.lin@realtek.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Incorrect error checking for `devm_auxiliary_device_create()` causes silent failure of reset controller registration.
- [High] Missing Kconfig dependency on `MFD_SYSCON` causes systematic probe failure.
- [Medium] `RTK_CLK_COMMON` selects `RESET_RTK_COMMON` without inheriting its dependency on `RESET_CONTROLLER`, leading to unmet dependency warnings and disabled drivers.
--
commit f56275b75755d51046b72d7894740ba1aaeaf03b
Author: Cheng-Yu Lee <cylee12@realtek.com>
clk: realtek: Introduce a common probe()
This commit adds rtk_clk_probe() to register clock hardware and the clock
provider for Realtek SoCs. It also registers an auxiliary device for the reset
controller if the "#reset-cells" property is present.
> diff --git a/drivers/clk/realtek/Kconfig b/drivers/clk/realtek/Kconfig
> new file mode 100644
> index 0000000000000..4e042e41f30da
> --- /dev/null
> +++ b/drivers/clk/realtek/Kconfig
[ ... ]
> +config RTK_CLK_COMMON
> + tristate "Realtek Clock Common"
> + select RESET_RTK_COMMON
Will selecting RESET_RTK_COMMON without inheriting its dependency on
RESET_CONTROLLER cause unmet dependency warnings?
In Kconfig, RESET_RTK_COMMON is implicitly dependent on RESET_CONTROLLER.
Selecting it without depends on RESET_CONTROLLER forces the symbol on even
when its dependencies are not met.
Additionally, because drivers/reset/ is only compiled when
CONFIG_RESET_CONTROLLER is enabled, the selected reset driver will silently
not be built if it is disabled.
Could depends on RESET_CONTROLLER be added here?
Should this config also add select MFD_SYSCON?
The driver unconditionally relies on device_node_to_regmap(), which is
provided by the MFD_SYSCON subsystem. If CONFIG_MFD_SYSCON is disabled,
the stub implementation unconditionally returns ERR_PTR(-ENOTSUPP).
Because RTK_CLK_COMMON does not select MFD_SYSCON and ARCH_REALTEK does not
select it either, the clock driver can be built without MFD_SYSCON, leading
to a systematic probe failure.
> + select AUXILIARY_BUS
> + help
> + Common helper code shared by Realtek clock controller drivers.
[ ... ]
> diff --git a/drivers/clk/realtek/common.c b/drivers/clk/realtek/common.c
> new file mode 100644
> index 0000000000000..56f6ba1af6ef4
> --- /dev/null
> +++ b/drivers/clk/realtek/common.c
[ ... ]
> +static int rtk_reset_controller_register(struct device *dev, const char *aux_name,
> + struct regmap *map)
> +{
> + struct auxiliary_device *adev;
> +
> + if (!of_property_present(dev->of_node, "#reset-cells"))
> + return 0;
> +
> + adev = devm_auxiliary_device_create(dev, aux_name, (void *)map);
> +
> + if (IS_ERR(adev))
> + return PTR_ERR(adev);
Is devm_auxiliary_device_create() returning NULL on failure instead of an
error pointer?
If it returns NULL, the IS_ERR(adev) check will be bypassed and the function
will silently return 0 on failure, leaving the required reset controller
unregistered.
Could this be updated to check for !adev and return -ENOMEM?
> +
> + return 0;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260508111641.3192177-1-eleanor.lin@realtek.com?part=3
next prev parent reply other threads:[~2026-05-08 21:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 11:16 [PATCH v7 00/10] clk: realtek: Add RTD1625 clock support Yu-Chun Lin
2026-05-08 11:16 ` [PATCH v7 01/10] dt-bindings: clock: Add Realtek RTD1625 Clock & Reset Controller Yu-Chun Lin
2026-05-08 11:16 ` [PATCH v7 02/10] reset: Add Realtek basic reset support Yu-Chun Lin
2026-05-08 11:16 ` [PATCH v7 03/10] clk: realtek: Introduce a common probe() Yu-Chun Lin
2026-05-08 21:24 ` sashiko-bot [this message]
2026-05-08 11:16 ` [PATCH v7 04/10] clk: realtek: Add support for phase locked loops (PLLs) Yu-Chun Lin
2026-05-08 21:41 ` sashiko-bot
2026-05-08 11:16 ` [PATCH v7 05/10] clk: realtek: Add support for gate clock Yu-Chun Lin
2026-05-08 11:16 ` [PATCH v7 06/10] clk: realtek: Add support for mux clock Yu-Chun Lin
2026-05-08 22:21 ` sashiko-bot
2026-05-08 11:16 ` [PATCH v7 07/10] clk: realtek: Add support for MMC-tuned PLL clocks Yu-Chun Lin
2026-05-08 22:42 ` sashiko-bot
2026-05-08 11:16 ` [PATCH v7 08/10] clk: realtek: Add RTD1625-CRT clock controller driver Yu-Chun Lin
2026-05-08 23:17 ` sashiko-bot
2026-05-08 11:16 ` [PATCH v7 09/10] clk: realtek: Add RTD1625-ISO " Yu-Chun Lin
2026-05-08 23:50 ` sashiko-bot
2026-05-08 11:16 ` [PATCH v7 10/10] arm64: dts: realtek: Add clock support for RTD1625 Yu-Chun Lin
2026-05-08 23:55 ` sashiko-bot
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=20260508212425.DD28BC2BCB0@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eleanor.lin@realtek.com \
--cc=krzk+dt@kernel.org \
--cc=robh@kernel.org \
--cc=sashiko@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox