diff options
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/eeepc-laptop.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index db26f78cfc41..c6d765fec8e9 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
@@ -295,19 +295,25 @@ static ssize_t show_sys_acpi(struct device *dev, int cm, char *buf) | |||
295 | return sprintf(buf, "%d\n", value); | 295 | return sprintf(buf, "%d\n", value); |
296 | } | 296 | } |
297 | 297 | ||
298 | #define EEEPC_CREATE_DEVICE_ATTR(_name, _mode, _cm) \ | 298 | #define EEEPC_ACPI_SHOW_FUNC(_name, _cm) \ |
299 | static ssize_t _name##_show(struct device *dev, \ | 299 | static ssize_t _name##_show(struct device *dev, \ |
300 | struct device_attribute *attr, \ | 300 | struct device_attribute *attr, \ |
301 | char *buf) \ | 301 | char *buf) \ |
302 | { \ | 302 | { \ |
303 | return show_sys_acpi(dev, _cm, buf); \ | 303 | return show_sys_acpi(dev, _cm, buf); \ |
304 | } \ | 304 | } |
305 | |||
306 | #define EEEPC_ACPI_STORE_FUNC(_name, _cm) \ | ||
305 | static ssize_t _name##_store(struct device *dev, \ | 307 | static ssize_t _name##_store(struct device *dev, \ |
306 | struct device_attribute *attr, \ | 308 | struct device_attribute *attr, \ |
307 | const char *buf, size_t count) \ | 309 | const char *buf, size_t count) \ |
308 | { \ | 310 | { \ |
309 | return store_sys_acpi(dev, _cm, buf, count); \ | 311 | return store_sys_acpi(dev, _cm, buf, count); \ |
310 | } \ | 312 | } |
313 | |||
314 | #define EEEPC_CREATE_DEVICE_ATTR(_name, _mode, _cm) \ | ||
315 | EEEPC_ACPI_SHOW_FUNC(_name, _cm) \ | ||
316 | EEEPC_ACPI_STORE_FUNC(_name, _cm) \ | ||
311 | static DEVICE_ATTR(_name, _mode, _name##_show, _name##_store) | 317 | static DEVICE_ATTR(_name, _mode, _name##_show, _name##_store) |
312 | 318 | ||
313 | EEEPC_CREATE_DEVICE_ATTR(camera, 0644, CM_ASL_CAMERA); | 319 | EEEPC_CREATE_DEVICE_ATTR(camera, 0644, CM_ASL_CAMERA); |