diff options
author | Frans Klaver <fransklaver@gmail.com> | 2014-09-17 17:47:20 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2014-09-19 12:42:11 -0400 |
commit | 8c72fc8bd7c698d7b5c99b83e187fda0d1538e1a (patch) | |
tree | 4e4a77bb06ddc032c8322635112b802b4f1f0fd4 /drivers/platform | |
parent | 39a3e17e0d5c50e382992eeed6bb62668c31ded7 (diff) |
eeepc-laptop: change sysfs function names to API expectations
The eeepc-laptop driver follows the function naming convention
<action>_<attrname>(), while the sysfs macros are built around the
convention <attrname>_<action>(). Rename the sysfs functions to the
convention used by sysfs. This makes it easier to use the available API
later on.
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 | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c index 653999ee33fe..009444982070 100644 --- a/drivers/platform/x86/eeepc-laptop.c +++ b/drivers/platform/x86/eeepc-laptop.c | |||
@@ -296,13 +296,13 @@ static ssize_t show_sys_acpi(struct device *dev, int cm, char *buf) | |||
296 | } | 296 | } |
297 | 297 | ||
298 | #define EEEPC_CREATE_DEVICE_ATTR(_name, _mode, _cm) \ | 298 | #define EEEPC_CREATE_DEVICE_ATTR(_name, _mode, _cm) \ |
299 | static ssize_t show_##_name(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 | static ssize_t store_##_name(struct device *dev, \ | 305 | static ssize_t _name##_store(struct device *dev, \ |
306 | struct device_attribute *attr, \ | 306 | struct device_attribute *attr, \ |
307 | const char *buf, size_t count) \ | 307 | const char *buf, size_t count) \ |
308 | { \ | 308 | { \ |
@@ -312,8 +312,8 @@ static ssize_t show_sys_acpi(struct device *dev, int cm, char *buf) | |||
312 | .attr = { \ | 312 | .attr = { \ |
313 | .name = __stringify(_name), \ | 313 | .name = __stringify(_name), \ |
314 | .mode = _mode }, \ | 314 | .mode = _mode }, \ |
315 | .show = show_##_name, \ | 315 | .show = _name##_show, \ |
316 | .store = store_##_name, \ | 316 | .store = _name##_store, \ |
317 | } | 317 | } |
318 | 318 | ||
319 | EEEPC_CREATE_DEVICE_ATTR(camera, 0644, CM_ASL_CAMERA); | 319 | EEEPC_CREATE_DEVICE_ATTR(camera, 0644, CM_ASL_CAMERA); |
@@ -335,7 +335,7 @@ static int get_cpufv(struct eeepc_laptop *eeepc, struct eeepc_cpufv *c) | |||
335 | return 0; | 335 | return 0; |
336 | } | 336 | } |
337 | 337 | ||
338 | static ssize_t show_available_cpufv(struct device *dev, | 338 | static ssize_t available_cpufv_show(struct device *dev, |
339 | struct device_attribute *attr, | 339 | struct device_attribute *attr, |
340 | char *buf) | 340 | char *buf) |
341 | { | 341 | { |
@@ -352,7 +352,7 @@ static ssize_t show_available_cpufv(struct device *dev, | |||
352 | return len; | 352 | return len; |
353 | } | 353 | } |
354 | 354 | ||
355 | static ssize_t show_cpufv(struct device *dev, | 355 | static ssize_t cpufv_show(struct device *dev, |
356 | struct device_attribute *attr, | 356 | struct device_attribute *attr, |
357 | char *buf) | 357 | char *buf) |
358 | { | 358 | { |
@@ -364,7 +364,7 @@ static ssize_t show_cpufv(struct device *dev, | |||
364 | return sprintf(buf, "%#x\n", (c.num << 8) | c.cur); | 364 | return sprintf(buf, "%#x\n", (c.num << 8) | c.cur); |
365 | } | 365 | } |
366 | 366 | ||
367 | static ssize_t store_cpufv(struct device *dev, | 367 | static ssize_t cpufv_store(struct device *dev, |
368 | struct device_attribute *attr, | 368 | struct device_attribute *attr, |
369 | const char *buf, size_t count) | 369 | const char *buf, size_t count) |
370 | { | 370 | { |
@@ -385,7 +385,7 @@ static ssize_t store_cpufv(struct device *dev, | |||
385 | return count; | 385 | return count; |
386 | } | 386 | } |
387 | 387 | ||
388 | static ssize_t show_cpufv_disabled(struct device *dev, | 388 | static ssize_t cpufv_disabled_show(struct device *dev, |
389 | struct device_attribute *attr, | 389 | struct device_attribute *attr, |
390 | char *buf) | 390 | char *buf) |
391 | { | 391 | { |
@@ -394,7 +394,7 @@ static ssize_t show_cpufv_disabled(struct device *dev, | |||
394 | return sprintf(buf, "%d\n", eeepc->cpufv_disabled); | 394 | return sprintf(buf, "%d\n", eeepc->cpufv_disabled); |
395 | } | 395 | } |
396 | 396 | ||
397 | static ssize_t store_cpufv_disabled(struct device *dev, | 397 | static ssize_t cpufv_disabled_store(struct device *dev, |
398 | struct device_attribute *attr, | 398 | struct device_attribute *attr, |
399 | const char *buf, size_t count) | 399 | const char *buf, size_t count) |
400 | { | 400 | { |
@@ -424,23 +424,23 @@ static struct device_attribute dev_attr_cpufv = { | |||
424 | .attr = { | 424 | .attr = { |
425 | .name = "cpufv", | 425 | .name = "cpufv", |
426 | .mode = 0644 }, | 426 | .mode = 0644 }, |
427 | .show = show_cpufv, | 427 | .show = cpufv_show, |
428 | .store = store_cpufv | 428 | .store = cpufv_store |
429 | }; | 429 | }; |
430 | 430 | ||
431 | static struct device_attribute dev_attr_available_cpufv = { | 431 | static struct device_attribute dev_attr_available_cpufv = { |
432 | .attr = { | 432 | .attr = { |
433 | .name = "available_cpufv", | 433 | .name = "available_cpufv", |
434 | .mode = 0444 }, | 434 | .mode = 0444 }, |
435 | .show = show_available_cpufv | 435 | .show = available_cpufv_show |
436 | }; | 436 | }; |
437 | 437 | ||
438 | static struct device_attribute dev_attr_cpufv_disabled = { | 438 | static struct device_attribute dev_attr_cpufv_disabled = { |
439 | .attr = { | 439 | .attr = { |
440 | .name = "cpufv_disabled", | 440 | .name = "cpufv_disabled", |
441 | .mode = 0644 }, | 441 | .mode = 0644 }, |
442 | .show = show_cpufv_disabled, | 442 | .show = cpufv_disabled_show, |
443 | .store = store_cpufv_disabled | 443 | .store = cpufv_disabled_store |
444 | }; | 444 | }; |
445 | 445 | ||
446 | 446 | ||