pwm: sysfs: Properly convert from enum to string
authorThierry Reding <thierry.reding@gmail.com>
Mon, 20 Jul 2015 07:56:05 +0000 (09:56 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 27 Jul 2015 10:03:37 +0000 (12:03 +0200)
commit5a063d87e97df28ca0b00807bc4d6fa11c5a5107
tree17b7cec307e98f14d1c943ee0de230454666af0c
parent15da7b5001e498fa7dc619d4d7951f9665b071e4
pwm: sysfs: Properly convert from enum to string

The current code will check for polarity in a boolean way. While it is
correct that polarity is either normal or inversed, make it more obvious
that it's an enumeration by using a switch statement and explicit
matches on the enumeration values.

Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/sysfs.c