pwm: modify PWM_LOOKUP to initialize all struct pwm_lookup members
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Mon, 19 May 2014 20:42:37 +0000 (22:42 +0200)
committerStephane Desneux <stephane.desneux@open.eurogiciel.org>
Wed, 4 Feb 2015 10:14:40 +0000 (11:14 +0100)
Now that PWM_LOOKUP is not used anymore, modify it to initialize all the
members of struct pwm_lookup.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
(cherry picked from commit 4284402924cc55e182008ca7e9d4fb1e891ff5ae)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Documentation/pwm.txt
include/linux/pwm.h

index 93cb979..f38f99c 100644 (file)
@@ -19,7 +19,8 @@ should instead register a static mapping that can be used to match PWM
 consumers to providers, as given in the following example:
 
        static struct pwm_lookup board_pwm_lookup[] = {
-               PWM_LOOKUP("tegra-pwm", 0, "pwm-backlight", NULL),
+               PWM_LOOKUP("tegra-pwm", 0, "pwm-backlight", NULL,
+                          50000, PWM_POLARITY_NORMAL),
        };
 
        static void __init board_init(void)
index 29ca457..e16ee37 100644 (file)
@@ -278,12 +278,14 @@ struct pwm_lookup {
        enum pwm_polarity polarity;
 };
 
-#define PWM_LOOKUP(_provider, _index, _dev_id, _con_id)        \
+#define PWM_LOOKUP(_provider, _index, _dev_id, _con_id, _period, _polarity) \
        {                                               \
                .provider = _provider,                  \
                .index = _index,                        \
                .dev_id = _dev_id,                      \
                .con_id = _con_id,                      \
+               .period = _period,                      \
+               .polarity = _polarity                   \
        }
 
 #if IS_ENABLED(CONFIG_PWM)