From: Evgeny Bachinin <EABachinin@salutedevices.com>
To: Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Evgeny Bachinin <EABachinin@salutedevices.com>,
Dmitry Rokosov <ddrokosov@sberdevices.ru>,
Miles Chen <miles.chen@mediatek.com>,
Alexey Romanov <avromanov@salutedevices.com>
Cc: <kernel@sberdevices.ru>, <evgen89bachinin@gmail.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-amlogic@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v1 1/2] firmware: meson_sm: refactor serial sysfs entry via dev_groups attrs
Date: Wed, 8 Nov 2023 15:56:03 +0300 [thread overview]
Message-ID: <20231108125604.162383-2-EABachinin@salutedevices.com> (raw)
In-Reply-To: <20231108125604.162383-1-EABachinin@salutedevices.com>
Introduce just another way to register sysfs serial entry:
the less code, the better in the absence of extra error-paths
Signed-off-by: Evgeny Bachinin <EABachinin@salutedevices.com>
---
drivers/firmware/meson/meson_sm.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c
index 27a8cd4747f8..73878ff9833c 100644
--- a/drivers/firmware/meson/meson_sm.c
+++ b/drivers/firmware/meson/meson_sm.c
@@ -273,14 +273,11 @@ static ssize_t serial_show(struct device *dev, struct device_attribute *attr,
static DEVICE_ATTR_RO(serial);
-static struct attribute *meson_sm_sysfs_attributes[] = {
+static struct attribute *meson_sm_sysfs_attrs[] = {
&dev_attr_serial.attr,
NULL,
};
-
-static const struct attribute_group meson_sm_sysfs_attr_group = {
- .attrs = meson_sm_sysfs_attributes,
-};
+ATTRIBUTE_GROUPS(meson_sm_sysfs);
static const struct of_device_id meson_sm_ids[] = {
{ .compatible = "amlogic,meson-gxbb-sm", .data = &gxbb_chip },
@@ -320,9 +317,6 @@ static int __init meson_sm_probe(struct platform_device *pdev)
if (devm_of_platform_populate(dev))
goto out_in_base;
- if (sysfs_create_group(&pdev->dev.kobj, &meson_sm_sysfs_attr_group))
- goto out_in_base;
-
pr_info("secure-monitor enabled\n");
return 0;
@@ -337,6 +331,7 @@ static struct platform_driver meson_sm_driver = {
.driver = {
.name = "meson-sm",
.of_match_table = of_match_ptr(meson_sm_ids),
+ .dev_groups = meson_sm_sysfs_groups,
},
};
module_platform_driver_probe(meson_sm_driver, meson_sm_probe);
--
2.34.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2023-11-08 12:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-08 12:56 [PATCH v1 0/2] firmware: meson_sm: cleanup error paths inside probe() Evgeny Bachinin
2023-11-08 12:56 ` Evgeny Bachinin [this message]
2023-11-08 12:56 ` [PATCH v1 2/2] firmware: meson-sm: unmap out_base shmem in error path Evgeny Bachinin
2023-11-27 8:02 ` [PATCH v1 0/2] firmware: meson_sm: cleanup error paths inside probe() Neil Armstrong
2023-11-27 8:18 ` Neil Armstrong
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=20231108125604.162383-2-EABachinin@salutedevices.com \
--to=eabachinin@salutedevices.com \
--cc=avromanov@salutedevices.com \
--cc=ddrokosov@sberdevices.ru \
--cc=evgen89bachinin@gmail.com \
--cc=jbrunet@baylibre.com \
--cc=kernel@sberdevices.ru \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=miles.chen@mediatek.com \
--cc=neil.armstrong@linaro.org \
/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
all inboxes | Powered by JetHome®