]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
pwm: Add a stub for devm_pwmchip_add()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 17 Nov 2022 11:08:00 +0000 (13:08 +0200)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:20:44 +0000 (17:20 +0200)
BugLink: https://bugs.launchpad.net/bugs/2037005
commit 88da4e8113110d5f4ebdd2f8cd0899e300cd1954 upstream.

The devm_pwmchip_add() can be called by a module that optionally
instantiates PWM chip. In the case of CONFIG_PWM=n, the compilation
can't be performed. Hence, add a necessary stub.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
include/linux/pwm.h

index 161e91167b9c01de182731803d1d5e898ccd5e68..faca8e2bb1b3161cdc9455f8048c0585d31eb407 100644 (file)
@@ -483,6 +483,11 @@ static inline int devm_pwmchip_add(struct device *dev, struct pwm_chip *chip)
        return -EINVAL;
 }
 
+static inline int devm_pwmchip_add(struct device *dev, struct pwm_chip *chip)
+{
+       return -EINVAL;
+}
+
 static inline struct pwm_device *pwm_request_from_chip(struct pwm_chip *chip,
                                                       unsigned int index,
                                                       const char *label)