diff options
author | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-05-31 17:09:59 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2018-05-31 17:13:31 -0400 |
commit | 696fa1d043ecd605166cc97b24c0b7a59dd5a135 (patch) | |
tree | c45b0766f03008f2e9348cd557f7117985dcf4c5 /drivers/rtc/rtc-test.c | |
parent | 8be09029940227d30ae310bb3fe25bc8abbfe140 (diff) |
rtc: test: remove irq sysfs file
Now that alarms are emulated, remove the irq sysfs file that could be used
to send alarms.
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-test.c')
-rw-r--r-- | drivers/rtc/rtc-test.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index 3aee7be3a58a..70d4ab1d2769 100644 --- a/drivers/rtc/rtc-test.c +++ b/drivers/rtc/rtc-test.c | |||
@@ -110,37 +110,6 @@ static void test_rtc_alarm_handler(struct timer_list *t) | |||
110 | rtc_update_irq(rtd->rtc, 1, RTC_AF | RTC_IRQF); | 110 | rtc_update_irq(rtd->rtc, 1, RTC_AF | RTC_IRQF); |
111 | } | 111 | } |
112 | 112 | ||
113 | static ssize_t test_irq_show(struct device *dev, | ||
114 | struct device_attribute *attr, char *buf) | ||
115 | { | ||
116 | return sprintf(buf, "%d\n", 42); | ||
117 | } | ||
118 | static ssize_t test_irq_store(struct device *dev, | ||
119 | struct device_attribute *attr, | ||
120 | const char *buf, size_t count) | ||
121 | { | ||
122 | int retval; | ||
123 | struct rtc_device *rtc = dev_get_drvdata(dev); | ||
124 | |||
125 | retval = count; | ||
126 | if (strncmp(buf, "tick", 4) == 0 && rtc->pie_enabled) | ||
127 | rtc_update_irq(rtc, 1, RTC_PF | RTC_IRQF); | ||
128 | else if (strncmp(buf, "alarm", 5) == 0) { | ||
129 | struct rtc_wkalrm alrm; | ||
130 | int err = rtc_read_alarm(rtc, &alrm); | ||
131 | |||
132 | if (!err && alrm.enabled) | ||
133 | rtc_update_irq(rtc, 1, RTC_AF | RTC_IRQF); | ||
134 | |||
135 | } else if (strncmp(buf, "update", 6) == 0 && rtc->uie_rtctimer.enabled) | ||
136 | rtc_update_irq(rtc, 1, RTC_UF | RTC_IRQF); | ||
137 | else | ||
138 | retval = -EINVAL; | ||
139 | |||
140 | return retval; | ||
141 | } | ||
142 | static DEVICE_ATTR(irq, S_IRUGO | S_IWUSR, test_irq_show, test_irq_store); | ||
143 | |||
144 | static int test_probe(struct platform_device *plat_dev) | 113 | static int test_probe(struct platform_device *plat_dev) |
145 | { | 114 | { |
146 | struct rtc_test_data *rtd; | 115 | struct rtc_test_data *rtd; |
@@ -162,16 +131,8 @@ static int test_probe(struct platform_device *plat_dev) | |||
162 | return 0; | 131 | return 0; |
163 | } | 132 | } |
164 | 133 | ||
165 | static int test_remove(struct platform_device *plat_dev) | ||
166 | { | ||
167 | device_remove_file(&plat_dev->dev, &dev_attr_irq); | ||
168 | |||
169 | return 0; | ||
170 | } | ||
171 | |||
172 | static struct platform_driver test_driver = { | 134 | static struct platform_driver test_driver = { |
173 | .probe = test_probe, | 135 | .probe = test_probe, |
174 | .remove = test_remove, | ||
175 | .driver = { | 136 | .driver = { |
176 | .name = "rtc-test", | 137 | .name = "rtc-test", |
177 | }, | 138 | }, |