From: sashiko-bot@kernel.org
To: "Reza Kurniawan" <imkyufie@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 1/2] power: supply: bq256xx: Expose VBUS state through extcon
Date: Sat, 12 Sep 2026 12:37:40 +0000 [thread overview]
Message-ID: <20260912123740.B9A2B1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260912-riva-usb-v1-1-0acd5cf8c62a@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Missing Kconfig dependency for EXTCON causes build failures, or runtime probe regression when CONFIG_EXTCON is disabled.
--
commit 6faa47b2b9aa55be622397291bdc7fb836f78d0c
Author: Reza Kurniawan <imkyufie@gmail.com>
power: supply: bq256xx: Expose VBUS state through extcon
This commit adds support to report VBUS state changes through the extcon
subsystem for the bq256xx charger. This allows USB controllers to sense
power input presence on devices where the VBUS session comparator is not
directly wired.
> diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/bq256xx_charger.c
> index 4b1f81b1ed867..46b036be38dd8 100644
> --- a/drivers/power/supply/bq256xx_charger.c
> +++ b/drivers/power/supply/bq256xx_charger.c
[ ... ]
> @@ -1554,6 +1586,40 @@ static int bq256xx_power_supply_init(struct bq256xx_device *bq,
> return 0;
> }
>
> +static const unsigned int bq256xx_usb_extcon_cable[] = {
> + EXTCON_USB,
> + EXTCON_NONE,
> +};
> +
> +static int bq256xx_extcon_init(struct bq256xx_device *bq)
> +{
> + unsigned int charger_status_0;
> + int ret;
> +
> + bq->edev = devm_extcon_dev_allocate(bq->dev, bq256xx_usb_extcon_cable);
> + if (IS_ERR(bq->edev)) {
> + dev_err(bq->dev, "Failed to allocate extcon device\n");
> + return PTR_ERR(bq->edev);
[Severity: High]
When the extcon configuration is disabled, the dummy inline implementation
of devm_extcon_dev_allocate in extcon-provider.h returns -ENOSYS. Will
this cause bq256xx_extcon_init in drivers/power/supply/bq256xx_charger.c
to immediately return a fatal error on systems without extcon support?
> + }
> +
> + ret = devm_extcon_dev_register(bq->dev, bq->edev);
[ ... ]
> @@ -1743,6 +1809,12 @@ static int bq256xx_probe(struct i2c_client *client)
> if (!IS_ERR_OR_NULL(bq->usb3_phy))
> usb_register_notifier(bq->usb3_phy, &bq->usb_nb);
>
> + ret = bq256xx_extcon_init(bq);
> + if (ret) {
> + dev_err(dev, "Failed to register extcon device\n");
> + return ret;
[Severity: High]
Because the -ENOSYS error propagates here, does this unconditionally abort
the entire driver probe in bq256xx_probe when extcon is disabled?
Since extcon appears to be an optional feature for exposing VBUS state,
should this missing dependency be handled more gracefully, perhaps by
treating -ENOSYS as non-fatal or adding a proper dependency in the build
configuration?
> + }
> +
> if (client->irq) {
> ret = devm_request_threaded_irq(dev, client->irq, NULL,
> bq256xx_irq_handler_thread,
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260912-riva-usb-v1-0-0acd5cf8c62a@gmail.com?part=1
next prev parent reply other threads:[~2026-09-12 12:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-12 12:27 [PATCH 0/2] Enable USB support (peripheral mode) for Xiaomi Redmi 5A (riva) Reza Kurniawan
2026-09-12 12:27 ` [PATCH 1/2] power: supply: bq256xx: Expose VBUS state through extcon Reza Kurniawan
2026-09-12 12:37 ` sashiko-bot [this message]
2026-09-12 12:27 ` [PATCH 2/2] arm64: dts: qcom: msm8917-xiaomi-riva: Enable USB support (peripheral mode) Reza Kurniawan
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=20260912123740.B9A2B1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=imkyufie@gmail.com \
--cc=robh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox