From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
Cc: bleung@chromium.org, lee@kernel.org, groeck@chromium.org,
jthies@google.com, chrome-platform@lists.linux.dev,
mfd@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mfd: cros_ec: Drop OF node reference in ec_device_probe()
Date: Mon, 23 Nov 2026 02:03:54 +0000 [thread overview]
Message-ID: <awOfCgL-eriqrws7@google.com> (raw)
In-Reply-To: <20261118062949.1250-1-laixiangwu@cmss.chinamobile.com>
On Wed, Nov 18, 2026 at 02:29:48PM +0800, Xiangwu Lai wrote:
> diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
> index 529a23b80..b8d363b7a 100644
> --- a/drivers/mfd/cros_ec_dev.c
> +++ b/drivers/mfd/cros_ec_dev.c
> @@ -271,14 +271,20 @@ static int ec_device_probe(struct platform_device *pdev)
> */
> if (cros_ec_check_features(ec, EC_FEATURE_USB_PD) &&
> cros_ec_check_features(ec, EC_FEATURE_UCSI_PPM) &&
> - !acpi_dev_found("GOOG0021") &&
> - !of_find_compatible_node(NULL, NULL, "google,cros-ec-ucsi")) {
> - retval = mfd_add_hotplug_devices(ec->dev,
> - cros_ec_ucsi_cells,
> - ARRAY_SIZE(cros_ec_ucsi_cells));
> + !acpi_dev_found("GOOG0021")) {
> + struct device_node *np __free(device_node) =
> + of_find_compatible_node(NULL, NULL, "google,cros-ec-ucsi");
__free() is defined in <linux/cleanup.h>. Please include it in the file.
Alternatively, simply calling `of_node_put()` after using `np` also works.
>
> - if (retval)
> - dev_warn(ec->dev, "failed to add cros_ec_ucsi: %d\n", retval);
> + if (!np) {
> + retval = mfd_add_hotplug_devices(ec->dev,
> + cros_ec_ucsi_cells,
> + ARRAY_SIZE(cros_ec_ucsi_cells));
./scripts/checkpatch.pl --strict:
CHECK: Alignment should match open parenthesis
#61: FILE: drivers/mfd/cros_ec_dev.c:280:
+ retval = mfd_add_hotplug_devices(ec->dev,
+ cros_ec_ucsi_cells,
prev parent reply other threads:[~2026-11-23 2:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 6:29 [PATCH v2] mfd: cros_ec: Drop OF node reference in ec_device_probe() Xiangwu Lai
2026-11-18 17:20 ` Benson Leung
2026-11-23 2:03 ` Tzung-Bi Shih [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=awOfCgL-eriqrws7@google.com \
--to=tzungbi@kernel.org \
--cc=bleung@chromium.org \
--cc=chrome-platform@lists.linux.dev \
--cc=groeck@chromium.org \
--cc=jthies@google.com \
--cc=laixiangwu@cmss.chinamobile.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfd@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