Commit 53d421d2 authored by Sudeep Holla's avatar Sudeep Holla

ARM: OMAP2: Switch to use DEVICE_ATTR_RO()

Move device attributes to DEVICE_ATTR_RO() as that would make things
a lot more "obvious" what is happening over the existing __ATTR usage.

Link: https://lore.kernel.org/r/20200523170859.50003-8-sudeep.holla@arm.com
Cc: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent d7a1a4f4
...@@ -775,15 +775,13 @@ static const char * __init omap_get_family(void) ...@@ -775,15 +775,13 @@ static const char * __init omap_get_family(void)
return kasprintf(GFP_KERNEL, "Unknown"); return kasprintf(GFP_KERNEL, "Unknown");
} }
static ssize_t omap_get_type(struct device *dev, static ssize_t
struct device_attribute *attr, type_show(struct device *dev, struct device_attribute *attr, char *buf)
char *buf)
{ {
return sprintf(buf, "%s\n", omap_types[omap_type()]); return sprintf(buf, "%s\n", omap_types[omap_type()]);
} }
static struct device_attribute omap_soc_attr = static DEVICE_ATTR_RO(type);
__ATTR(type, S_IRUGO, omap_get_type, NULL);
void __init omap_soc_device_init(void) void __init omap_soc_device_init(void)
{ {
...@@ -806,6 +804,6 @@ void __init omap_soc_device_init(void) ...@@ -806,6 +804,6 @@ void __init omap_soc_device_init(void)
} }
parent = soc_device_to_device(soc_dev); parent = soc_device_to_device(soc_dev);
device_create_file(parent, &omap_soc_attr); device_create_file(parent, &dev_attr_type);
} }
#endif /* CONFIG_SOC_BUS */ #endif /* CONFIG_SOC_BUS */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment