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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user