From: Matthias Kaehlcke <mka@chromium.org>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Sebastian Reichel <sre@kernel.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Tom Rix <trix@redhat.com>, SeongJae Park <sj@kernel.org>
Subject: Re: [PATCH] power: supply: core: Move psy_has_property() to fix build
Date: Wed, 29 Sep 2021 09:02:17 -0700 [thread overview]
Message-ID: <YVSOCZZiSjMX5Ul7@google.com> (raw)
In-Reply-To: <7b35a74f2c2ad19c8dc1ca60c59e48a14288677f.1632830348.git.geert+renesas@glider.be>
On Tue, Sep 28, 2021 at 02:00:19PM +0200, Geert Uytterhoeven wrote:
> If CONFIG_THERMAL=n:
>
> drivers/power/supply/power_supply_core.c: In function ‘__power_supply_register’:
> drivers/power/supply/power_supply_core.c:1137:6: error: implicit declaration of function ‘psy_has_property’ [-Werror=implicit-function-declaration]
> 1137 | if (psy_has_property(desc, POWER_SUPPLY_PROP_USB_TYPE) &&
> | ^~~~~~~~~~~~~~~~
>
> Fix this by moving psy_has_property() outside the section protected by
> CONFIG_THERMAL.
>
> Fixes: 9ba533eb99bb2acf ("power: supply: core: Add psy_has_property()")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> drivers/power/supply/power_supply_core.c | 32 ++++++++++++------------
> 1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
> index 75575ea45f21ddc7..fc12a4f407f431a6 100644
> --- a/drivers/power/supply/power_supply_core.c
> +++ b/drivers/power/supply/power_supply_core.c
> @@ -951,6 +951,22 @@ void power_supply_unreg_notifier(struct notifier_block *nb)
> }
> EXPORT_SYMBOL_GPL(power_supply_unreg_notifier);
>
> +static bool psy_has_property(const struct power_supply_desc *psy_desc,
> + enum power_supply_property psp)
> +{
> + bool found = false;
> + int i;
> +
> + for (i = 0; i < psy_desc->num_properties; i++) {
> + if (psy_desc->properties[i] == psp) {
> + found = true;
> + break;
> + }
> + }
> +
> + return found;
> +}
> +
> #ifdef CONFIG_THERMAL
> static int power_supply_read_temp(struct thermal_zone_device *tzd,
> int *temp)
> @@ -975,22 +991,6 @@ static struct thermal_zone_device_ops psy_tzd_ops = {
> .get_temp = power_supply_read_temp,
> };
>
> -static bool psy_has_property(const struct power_supply_desc *psy_desc,
> - enum power_supply_property psp)
> -{
> - bool found = false;
> - int i;
> -
> - for (i = 0; i < psy_desc->num_properties; i++) {
> - if (psy_desc->properties[i] == psp) {
> - found = true;
> - break;
> - }
> - }
> -
> - return found;
> -}
> -
> static int psy_register_thermal(struct power_supply *psy)
> {
> int ret;
Thanks for the fix!
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
next prev parent reply other threads:[~2021-09-29 16:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 12:00 [PATCH] power: supply: core: Move psy_has_property() to fix build Geert Uytterhoeven
2021-09-29 16:02 ` Matthias Kaehlcke [this message]
2021-09-30 10:50 ` Sebastian Reichel
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=YVSOCZZiSjMX5Ul7@google.com \
--to=mka@chromium.org \
--cc=geert+renesas@glider.be \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sj@kernel.org \
--cc=sre@kernel.org \
--cc=trix@redhat.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 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.