misc: pm8058-pwm: use small functions to replace bigger ones

Add small functions to replace bigger ones for better readability
and error checking.

Signed-off-by: Willie Ruan <wruan@codeaurora.org>
1 file changed