Re: [PATCH v2 1/9] power: supply: core: Add power_supply_has_property_direct()
From: Armin Wolf
Date: Tue Dec 01 2026 - 09:20:08 EST
Am 01.12.26 um 15:14 schrieb Ilpo Järvinen:
On Tue, 1 Dec 2026, Armin Wolf wrote:
Am 01.12.26 um 13:29 schrieb Ilpo Järvinen:
On Tue, 10 Nov 2026, Armin Wolf wrote:
Providers of power supply extensions might want to check if a given
power supply supports a given property in order to select a suitable
extension to load.
Add power_supply_has_property_direct() to enable such use cases.
Signed-off-by: Armin Wolf <W_Armin@xxxxxx>
---
drivers/power/supply/power_supply_core.c | 26 ++++++++++++++++++++----
include/linux/power_supply.h | 1 +
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/drivers/power/supply/power_supply_core.c
b/drivers/power/supply/power_supply_core.c
index 1cc203f2780b..75b53aec5db4 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -1367,17 +1367,35 @@ bool power_supply_ext_has_property(const struct
power_supply_ext *psy_ext,
return false;
}
-bool power_supply_has_property(struct power_supply *psy,
- enum power_supply_property psp)
+/**
+ * power_supply_has_property_direct - Check if a power supply property
exists without checking
+ * for extensions
+ * @psy: The power supply
+ * @psp: The power supply property to check
+ *
+ * Check if a given power supply support a given power supply property
without taking into account
+ * any power supply extesions registered on said power supply. This is
mostly useful for determining
+ * if a power supply extension should be registered for the power supply
or not.
Please fix the minor errors mentioned by sashiko.
It would save me some time if you'd proactively look at sashiko's
reports for your own work and fix obvious findings without me having to
specifically ask for that. It's much more useful way to spend time when
than pinging me. ;-)
I'd also prefer the comment is limited to 80 chars.
For the entire series once this is fixed:
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
Sorry for wasting your time, i assumed that complains from Sashiko are
delivered via mail. It seems that only some mailing list have this, so
i wrongly thought that everything was fine :/
It's a balancing act. Auto-sending reports is not currentlt enabled
because I don't want newcomers to face massive reports about pre-existing
issues. I've considered asking this to be changed because sashiko has
gotten significant better in not reporting gazillions of old issues for
every patch (many of which are low value anyway relating to rollback and
remove corner cases).
We have lots of first time submitters compared to other areas as there are
plenty of devices we cannot test ourselves and having them fight with an
AI review bot that never tires in finding more and more pre-existing
issues might quickly become counterproductive.
I understand, personally i have no problem with manually checking the website.
Thanks,
Armin Wolf
I will fix any findings and send a v3 series.
Thanks.