diff options
author | Arnd Bergmann <arnd@arndb.de> | 2023-12-22 14:21:13 +0300 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2023-12-22 14:21:21 +0300 |
commit | 418188d878d522e751f7afcf08fd4f2b145fa854 (patch) | |
tree | ac10510519858f070141c6929b2d784c1c6aebe9 /drivers/firmware/meson/meson_sm.c | |
parent | 815cdfaf33914b15ede633ce9a7dfef0b3a3f053 (diff) | |
parent | d8385d7433f9c7d718448465e30d6b8c1207b59f (diff) | |
download | linux-418188d878d522e751f7afcf08fd4f2b145fa854.tar.xz |
Merge tag 'amlogic-drivers-for-v6.8' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into soc/drivers
Amlogic drivers changes for v6.8:
- meson-sm: unmap out_base shmem in error path
- meson-sm: use dev_groups attrs for sysfs entries
* tag 'amlogic-drivers-for-v6.8' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux:
firmware: meson-sm: unmap out_base shmem in error path
firmware: meson_sm: refactor serial sysfs entry via dev_groups attrs
Link: https://lore.kernel.org/r/a987f881-1c23-4528-9cb1-e5a875b7e7a8@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/firmware/meson/meson_sm.c')
-rw-r--r-- | drivers/firmware/meson/meson_sm.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c index ed60f1103053..5d7f62fe1d5f 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 }, @@ -313,7 +310,7 @@ static int __init meson_sm_probe(struct platform_device *pdev) fw->sm_shmem_out_base = meson_sm_map_shmem(chip->cmd_shmem_out_base, chip->shmem_size); if (WARN_ON(!fw->sm_shmem_out_base)) - goto out_in_base; + goto unmap_in_base; } fw->chip = chip; @@ -321,16 +318,15 @@ static int __init meson_sm_probe(struct platform_device *pdev) platform_set_drvdata(pdev, fw); 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; + goto unmap_out_base; pr_info("secure-monitor enabled\n"); return 0; -out_in_base: +unmap_out_base: + iounmap(fw->sm_shmem_out_base); +unmap_in_base: iounmap(fw->sm_shmem_in_base); out: return -EINVAL; @@ -340,6 +336,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); |