lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1564040858-24202-1-git-send-email-rtresidd@electromag.com.au>
Date:   Thu, 25 Jul 2019 15:47:38 +0800
From:   Richard Tresidder <rtresidd@...ctromag.com.au>
To:     sre@...nel.org, enric.balletbo@...labora.com, ncrews@...omium.org,
        andrew.smirnov@...il.com, groeck@...omium.org,
        david@...hnology.com, rtresidd@...ctromag.com.au,
        tglx@...utronix.de, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH 1/1] power/supply/powersupply_sysfs: Add of_node name to uevent message if available

If the of_node name of the supply is available from the devicetree binding
then include it under the var POWER_SUPPLY_OF_NODE_NAME.
This helps where a consistent name is known via the device tree binding
but it is hard to identify based on the usual enumeration process.

Signed-off-by: Richard Tresidder <rtresidd@...ctromag.com.au>
---

Notes:
    power/supply/powersupply_sysfs: Add of_node name to uevent message if available
    
    If the of_node name of the supply is available from the devicetree binding
    then include it under the var POWER_SUPPLY_OF_NODE_NAME.
    This helps where a consistent name is known via the device tree binding
    but it is hard to identify based on the usual enumeration process.

 drivers/power/supply/power_supply_sysfs.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index f37ad4e..ce6671c 100644
--- a/drivers/power/supply/power_supply_sysfs.c
+++ b/drivers/power/supply/power_supply_sysfs.c
@@ -395,6 +395,13 @@ int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env)
 	if (ret)
 		return ret;
 
+	if (psy->of_node) {
+		ret = add_uevent_var(env, "POWER_SUPPLY_OF_NODE_NAME=%s",
+				     psy->of_node->name);
+		if (ret)
+			return ret;
+	}
+
 	prop_buf = (char *)get_zeroed_page(GFP_KERNEL);
 	if (!prop_buf)
 		return -ENOMEM;
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ