]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pwm: Add pwm_apply_state() compatibility stub
authorThierry Reding <thierry.reding@gmail.com>
Thu, 21 Dec 2023 10:08:02 +0000 (11:08 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Fri, 5 Jan 2024 08:33:10 +0000 (09:33 +0100)
In order to make the transition to the new pwm_apply_might_sleep() a bit
smoother, add a compatibility stub. This will prevent new calls to the
old function introduced via other subsystems from breaking builds. Once
the next merge window has closed we can take another stab at removing
the stub.

Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
include/linux/pwm.h

index 5dd665d8c909e781d257bdc2aaf32c7f2d21a9f2..2a5e1154652e8a71fb9749fa8405a5bd53fa4ef6 100644 (file)
@@ -537,6 +537,13 @@ static inline void pwm_apply_args(struct pwm_device *pwm)
        pwm_apply_might_sleep(pwm, &state);
 }
 
+/* only for backwards-compatibility, new code should not use this */
+static inline int pwm_apply_state(struct pwm_device *pwm,
+                                 const struct pwm_state *state)
+{
+       return pwm_apply_might_sleep(pwm, state);
+}
+
 struct pwm_lookup {
        struct list_head list;
        const char *provider;