[PATCH] pwm: berlin: fix build warning

Arnd Bergmann
2015-10-06T19:56:36Z

The newly added berlin pwm driver causes a build warning:

drivers/pwm/pwm-berlin.c: In function 'berlin_pwm_config':
drivers/pwm/pwm-berlin.c:61:32: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
struct berlin_pwm_chip *pwm = to_berlin_pwm_chip(chip);

This changes the prototype of the to_berlin_pwm_chip() the way it
was meant to be.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
On Monday 05 October 2015 16:30:15 Thierry Reding wrote:
> On Fri, Oct 02, 2015 at 04:59:47PM +0200, Antoine Tenart wrote:
> > Add a PWM controller driver for the Marvell Berlin SoCs. This PWM
> > controller has 4 channels.
> >
> > Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
> > Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> > ---
> > drivers/pwm/Kconfig | 9 ++
> > drivers/pwm/Makefile | 1 +
> > drivers/pwm/pwm-berlin.c | 221 +++++++++++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 231 insertions(+)
> > create mode 100644 drivers/pwm/pwm-berlin.c
>
> Applied, with minor tweaks, thanks.

Apparently the tweak has failed

diff --git a/drivers/pwm/pwm-berlin.c b/drivers/pwm/pwm-berlin.c
index a390de6a760f..97933d3b2cc4 100644
--- a/drivers/pwm/pwm-berlin.c
+++ b/drivers/pwm/pwm-berlin.c
@@ -33,7 +33,7 @@ struct berlin_pwm_chip {
void __iomem *base;
};

-static inline to_berlin_pwm_chip(struct pwm_chip *chip)
+static inline struct berlin_pwm_chip *to_berlin_pwm_chip(struct pwm_chip *chip)
{
return container_of((chip), struct berlin_pwm_chip, chip);
}