Skip to content

Commit 475d04b

Browse files
committed
ARM: OMAP2: Use custom soc attribute group instead of device_create_file
Commit c31e731 ("base: soc: Handle custom soc information sysfs entries") introduced custom soc attribute group in soc_device_attribute structure but there are no users treewide. While trying to understand the motivation and tried to use it, it was found lot of existing custom attributes can moved to use it instead of device_create_file. Though most of these never remove/cleanup the custom attribute as they never call soc_device_unregister, using these custom attribute group eliminate the need for any cleanup as the driver infrastructure will take care of that. Let us remove device_create_file and start using the custom attribute group in soc_device_attribute. Link: https://lore.kernel.org/r/[email protected] Cc: Tony Lindgren <[email protected]> Cc: [email protected] Reviewed-by: Greg Kroah-Hartman <[email protected]> Acked-by: Tony Lindgren <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
1 parent 53d421d commit 475d04b

File tree

1 file changed

+8
-4
lines changed
  • arch/arm/mach-omap2

1 file changed

+8
-4
lines changed

arch/arm/mach-omap2/id.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -783,9 +783,15 @@ type_show(struct device *dev, struct device_attribute *attr, char *buf)
783783

784784
static DEVICE_ATTR_RO(type);
785785

786+
static struct attribute *omap_soc_attrs[] = {
787+
&dev_attr_type.attr,
788+
NULL
789+
};
790+
791+
ATTRIBUTE_GROUPS(omap_soc);
792+
786793
void __init omap_soc_device_init(void)
787794
{
788-
struct device *parent;
789795
struct soc_device *soc_dev;
790796
struct soc_device_attribute *soc_dev_attr;
791797

@@ -796,14 +802,12 @@ void __init omap_soc_device_init(void)
796802
soc_dev_attr->machine = soc_name;
797803
soc_dev_attr->family = omap_get_family();
798804
soc_dev_attr->revision = soc_rev;
805+
soc_dev_attr->custom_attr_group = omap_soc_groups[0];
799806

800807
soc_dev = soc_device_register(soc_dev_attr);
801808
if (IS_ERR(soc_dev)) {
802809
kfree(soc_dev_attr);
803810
return;
804811
}
805-
806-
parent = soc_device_to_device(soc_dev);
807-
device_create_file(parent, &dev_attr_type);
808812
}
809813
#endif /* CONFIG_SOC_BUS */

0 commit comments

Comments
 (0)