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: <20250224204600.3138007-1-ovidiu.panait.oss@gmail.com>
Date: Mon, 24 Feb 2025 22:45:59 +0200
From: Ovidiu Panait <ovidiu.panait.oss@...il.com>
To: linux-kernel@...r.kernel.org
Cc: fancer.lancer@...il.com,
	linux-mips@...r.kernel.org,
	tsbogend@...ha.franken.de,
	Ovidiu Panait <ovidiu.panait.oss@...il.com>
Subject: [PATCH 1/2] bus: bt1-axi: use dev_groups to register attribute groups

Instead of manually adding/removing attribute groups, set dev_groups
pointer to have the driver core do it.

Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@...il.com>
---
 drivers/bus/bt1-axi.c | 31 ++-----------------------------
 1 file changed, 2 insertions(+), 29 deletions(-)

diff --git a/drivers/bus/bt1-axi.c b/drivers/bus/bt1-axi.c
index a5254c73bf43..240c7e77b35e 100644
--- a/drivers/bus/bt1-axi.c
+++ b/drivers/bus/bt1-axi.c
@@ -217,30 +217,6 @@ static struct attribute *bt1_axi_sysfs_attrs[] = {
 };
 ATTRIBUTE_GROUPS(bt1_axi_sysfs);
 
-static void bt1_axi_remove_sysfs(void *data)
-{
-	struct bt1_axi *axi = data;
-
-	device_remove_groups(axi->dev, bt1_axi_sysfs_groups);
-}
-
-static int bt1_axi_init_sysfs(struct bt1_axi *axi)
-{
-	int ret;
-
-	ret = device_add_groups(axi->dev, bt1_axi_sysfs_groups);
-	if (ret) {
-		dev_err(axi->dev, "Failed to add sysfs files group\n");
-		return ret;
-	}
-
-	ret = devm_add_action_or_reset(axi->dev, bt1_axi_remove_sysfs, axi);
-	if (ret)
-		dev_err(axi->dev, "Can't add AXI EHB sysfs remove action\n");
-
-	return ret;
-}
-
 static int bt1_axi_probe(struct platform_device *pdev)
 {
 	struct bt1_axi *axi;
@@ -266,10 +242,6 @@ static int bt1_axi_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = bt1_axi_init_sysfs(axi);
-	if (ret)
-		return ret;
-
 	return 0;
 }
 
@@ -283,7 +255,8 @@ static struct platform_driver bt1_axi_driver = {
 	.probe = bt1_axi_probe,
 	.driver = {
 		.name = "bt1-axi",
-		.of_match_table = bt1_axi_of_match
+		.of_match_table = bt1_axi_of_match,
+		.dev_groups =  bt1_axi_sysfs_groups,
 	}
 };
 module_platform_driver(bt1_axi_driver);
-- 
2.48.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ