Skip to content

Commit 53d421d

Browse files
committed
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/[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 d7a1a4f commit 53d421d

File tree

1 file changed

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

1 file changed

+4
-6
lines changed

arch/arm/mach-omap2/id.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -775,15 +775,13 @@ static const char * __init omap_get_family(void)
775775
return kasprintf(GFP_KERNEL, "Unknown");
776776
}
777777

778-
static ssize_t omap_get_type(struct device *dev,
779-
struct device_attribute *attr,
780-
char *buf)
778+
static ssize_t
779+
type_show(struct device *dev, struct device_attribute *attr, char *buf)
781780
{
782781
return sprintf(buf, "%s\n", omap_types[omap_type()]);
783782
}
784783

785-
static struct device_attribute omap_soc_attr =
786-
__ATTR(type, S_IRUGO, omap_get_type, NULL);
784+
static DEVICE_ATTR_RO(type);
787785

788786
void __init omap_soc_device_init(void)
789787
{
@@ -806,6 +804,6 @@ void __init omap_soc_device_init(void)
806804
}
807805

808806
parent = soc_device_to_device(soc_dev);
809-
device_create_file(parent, &omap_soc_attr);
807+
device_create_file(parent, &dev_attr_type);
810808
}
811809
#endif /* CONFIG_SOC_BUS */

0 commit comments

Comments
 (0)