diff options
author | Evgeny Bachinin <EABachinin@salutedevices.com> | 2023-11-08 15:56:03 +0300 |
---|---|---|
committer | Neil Armstrong <neil.armstrong@linaro.org> | 2023-11-27 11:17:51 +0300 |
commit | d397965e584e0f2c6193b927c1e7693d514a6738 (patch) | |
tree | f333e00b1e045ca6b9a592c659ae2eaed4e35b06 | |
parent | b85ea95d086471afb4ad062012a4d73cd328fa86 (diff) | |
download | linux-d397965e584e0f2c6193b927c1e7693d514a6738.tar.xz |
firmware: meson_sm: refactor serial sysfs entry via dev_groups attrs
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>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231108125604.162383-2-EABachinin@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
-rw-r--r-- | drivers/firmware/meson/meson_sm.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c index ed60f1103053..fb766e40a631 100644 --- a/drivers/firmware/meson/meson_sm.c +++ b/drivers/firmware/meson/meson_sm.c @@ -274,14 +274,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 }, @@ -323,9 +320,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; @@ -340,6 +334,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); |