diff options
author | Frans Klaver <fransklaver@gmail.com> | 2014-09-17 17:47:21 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2014-09-19 12:42:11 -0400 |
commit | bb382dbaba09e74d728160f398391960dda3faf1 (patch) | |
tree | 02181eed50da3c289a19f320997c682d21b223f9 /drivers/platform | |
parent | 8c72fc8bd7c698d7b5c99b83e187fda0d1538e1a (diff) |
eeepc-laptop: use DEVICE_ATTR* to instantiate device_attributes
Device attributes are instantiated manually, while we have DEVICE_ATTR*
macros available to do much of the work for us. Let's use them.
Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/eeepc-laptop.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 009444982070..db26f78cfc41 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
@@ -308,13 +308,7 @@ static ssize_t show_sys_acpi(struct device *dev, int cm, char *buf) | |||
308 | { \ | 308 | { \ |
309 | return store_sys_acpi(dev, _cm, buf, count); \ | 309 | return store_sys_acpi(dev, _cm, buf, count); \ |
310 | } \ | 310 | } \ |
311 | static struct device_attribute dev_attr_##_name = { \ | 311 | static DEVICE_ATTR(_name, _mode, _name##_show, _name##_store) |
312 | .attr = { \ | ||
313 | .name = __stringify(_name), \ | ||
314 | .mode = _mode }, \ | ||
315 | .show = _name##_show, \ | ||
316 | .store = _name##_store, \ | ||
317 | } | ||
318 | 312 | ||
319 | EEEPC_CREATE_DEVICE_ATTR(camera, 0644, CM_ASL_CAMERA); | 313 | EEEPC_CREATE_DEVICE_ATTR(camera, 0644, CM_ASL_CAMERA); |
320 | EEEPC_CREATE_DEVICE_ATTR(cardr, 0644, CM_ASL_CARDREADER); | 314 | EEEPC_CREATE_DEVICE_ATTR(cardr, 0644, CM_ASL_CARDREADER); |
@@ -420,29 +414,9 @@ static ssize_t cpufv_disabled_store(struct device *dev, | |||
420 | } | 414 | } |
421 | 415 | ||
422 | 416 | ||
423 | static struct device_attribute dev_attr_cpufv = { | 417 | static DEVICE_ATTR_RW(cpufv); |
424 | .attr = { | 418 | static DEVICE_ATTR_RO(available_cpufv); |
425 | .name = "cpufv", | 419 | static DEVICE_ATTR_RW(cpufv_disabled); |
426 | .mode = 0644 }, | ||
427 | .show = cpufv_show, | ||
428 | .store = cpufv_store | ||
429 | }; | ||
430 | |||
431 | static struct device_attribute dev_attr_available_cpufv = { | ||
432 | .attr = { | ||
433 | .name = "available_cpufv", | ||
434 | .mode = 0444 }, | ||
435 | .show = available_cpufv_show | ||
436 | }; | ||
437 | |||
438 | static struct device_attribute dev_attr_cpufv_disabled = { | ||
439 | .attr = { | ||
440 | .name = "cpufv_disabled", | ||
441 | .mode = 0644 }, | ||
442 | .show = cpufv_disabled_show, | ||
443 | .store = cpufv_disabled_store | ||
444 | }; | ||
445 | |||
446 | 420 | ||
447 | static struct attribute *platform_attributes[] = { | 421 | static struct attribute *platform_attributes[] = { |
448 | &dev_attr_camera.attr, | 422 | &dev_attr_camera.attr, |