pwm: twl: Use to_twl() instead of container_of()
PATCH 1/1 pwm: twl: Use to_twl() instead of container_of()
In twl6030_pwm_disable() use to_twl() instead of container_of() like in the rest of the driver.
--- drivers/pwm/pwm-twl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pwm/pwm-twl.c +1 -2
@@ -255,8 +255,7 @@ out:static void twl6030_pwm_disable (struct pwm_chip *chip,struct pwm_device *pwm) { - struct twl_pwm_chip *twl = container_of(chip, struct twl_pwm_chip, - chip); +struct twl_pwm_chip *twl =to_twl (chip);int ret;u8 val;
Signature · 1 line
1.8.1.3
Quoted 7 lines · Johannes Thumshirn
In
twl6030_pwm_disable()useto_twl()instead ofcontainer_of()like in the rest of the driver.Signed-off-by Johannes Thumshirn <[email protected]>--- drivers/pwm/pwm-twl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Hi Johannes,
I see that container_of() is also still used in twl4030_pwm_free() and twl6030_pwm_enable(). Would you mind fixing those up as well?
Thierry
Quoted 9 lines · Thierry Reding
Quoted 7 lines · Johannes Thumshirn
In
twl6030_pwm_disable()useto_twl()instead ofcontainer_of()like in the rest of the driver.Signed-off-by Johannes Thumshirn <[email protected]>--- drivers/pwm/pwm-twl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 6 lines
Hi Johannes,
I see that
container_of()is also still used intwl4030_pwm_free()andtwl6030_pwm_enable(). Would you mind fixing those up as well?Thierry
Oh sorry haven't seen them, I'll take care of it.
Johannes
PATCH 1/1 pwm: twl: Use to_twl() instead of container_of()
In reply to Johannes ThumshirnAlways use to_twl() for converting into private data instead of container_of()
--- drivers/pwm/pwm-twl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/pwm/pwm-twl.c +2 -4
@@ -200,8 +200,7 @@ out:static void twl4030_pwm_free (struct pwm_chip *chip,struct pwm_device *pwm) { - struct twl_pwm_chip *twl = container_of(chip, struct twl_pwm_chip, - chip); +struct twl_pwm_chip *twl =to_twl (chip);int ret;u8 val, mask;
@@ -231,8 +230,7 @@ out:static int twl6030_pwm_enable (struct pwm_chip *chip,struct pwm_device *pwm) { - struct twl_pwm_chip *twl = container_of(chip, struct twl_pwm_chip, - chip); +struct twm_pwm_chip *twl =to_twl (chip);int ret;u8 val;
Signature · 1 line
1.8.1.3
Quoted 6 lines · Johannes Thumshirn
Always use
to_twl()for converting into private data instead ofcontainer_of()Signed-off-by Johannes Thumshirn <[email protected]>--- drivers/pwm/pwm-twl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
I've squashed this patch into the previous one and applied to the for-next branch. Thanks,
Thierry
PATCH 1/1 pwm: twl: Fix typo that broke build
Fix a little type that unfortunately broke the build :-(
--- drivers/pwm/pwm-twl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-twl.c +1 -1
@@ -230,7 +230,7 @@ out:static int twl6030_pwm_enable (struct pwm_chip *chip,struct pwm_device *pwm) { -struct twm_pwm_chip *twl =to_twl (chip); +struct twl_pwm_chip *twl =to_twl (chip);int ret;u8 val;
Signature · 1 line
1.8.1.3
Re: [PATCH] pwm: twl: Fix typo that broke build
Quoted 5 lines · Johannes Thumshirn
Fix a little type that unfortunately broke the build :-(
Signed-off-by Johannes Thumshirn <[email protected]>--- drivers/pwm/pwm-twl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Uh... I hadn't noticed and deemed the patch trivial enough so I didn't even build test. That'll teach me. =\
Thierry
Re: [PATCH] pwm: twl: Fix typo that broke build
Quoted 11 lines · Thierry Reding
Quoted 5 lines · Johannes Thumshirn
Fix a little type that unfortunately broke the build :-(
Signed-off-by Johannes Thumshirn <[email protected]>--- drivers/pwm/pwm-twl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Uh... I hadn't noticed and deemed the patch trivial enough so I didn't even build test. That'll teach me. =\
Thierry
Me too.