diff options
-rw-r--r-- | drivers/sh/intc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/sh/intc.c b/drivers/sh/intc.c index f43850527645..b605f7e478d6 100644 --- a/drivers/sh/intc.c +++ b/drivers/sh/intc.c | |||
@@ -1034,6 +1034,18 @@ err0: | |||
1034 | return -ENOMEM; | 1034 | return -ENOMEM; |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | static ssize_t | ||
1038 | show_intc_name(struct sys_device *dev, struct sysdev_attribute *attr, char *buf) | ||
1039 | { | ||
1040 | struct intc_desc_int *d; | ||
1041 | |||
1042 | d = container_of(dev, struct intc_desc_int, sysdev); | ||
1043 | |||
1044 | return sprintf(buf, "%s\n", d->chip.name); | ||
1045 | } | ||
1046 | |||
1047 | static SYSDEV_ATTR(name, S_IRUGO, show_intc_name, NULL); | ||
1048 | |||
1037 | static int intc_suspend(struct sys_device *dev, pm_message_t state) | 1049 | static int intc_suspend(struct sys_device *dev, pm_message_t state) |
1038 | { | 1050 | { |
1039 | struct intc_desc_int *d; | 1051 | struct intc_desc_int *d; |
@@ -1098,8 +1110,12 @@ static int __init register_intc_sysdevs(void) | |||
1098 | d->sysdev.id = id; | 1110 | d->sysdev.id = id; |
1099 | d->sysdev.cls = &intc_sysdev_class; | 1111 | d->sysdev.cls = &intc_sysdev_class; |
1100 | error = sysdev_register(&d->sysdev); | 1112 | error = sysdev_register(&d->sysdev); |
1113 | if (error == 0) | ||
1114 | error = sysdev_create_file(&d->sysdev, | ||
1115 | &attr_name); | ||
1101 | if (error) | 1116 | if (error) |
1102 | break; | 1117 | break; |
1118 | |||
1103 | id++; | 1119 | id++; |
1104 | } | 1120 | } |
1105 | } | 1121 | } |