[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221117110806.65470-7-andriy.shevchenko@linux.intel.com>
Date: Thu, 17 Nov 2022 13:08:05 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Hans de Goede <hdegoede@...hat.com>,
Thierry Reding <thierry.reding@...il.com>,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-pwm@...r.kernel.org
Cc: Andy Shevchenko <andy@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH v5 6/7] pwm: lpss: Add devm_pwm_lpss_probe() stub
In case the PWM LPSS module is not provided, allow users to be
compiled with the help of the devm_pwm_lpss_probe() stub.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Acked-by: Thierry Reding <thierry.reding@...il.com>
Reviewed-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
---
include/linux/platform_data/x86/pwm-lpss.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/linux/platform_data/x86/pwm-lpss.h b/include/linux/platform_data/x86/pwm-lpss.h
index c852fe24fe2a..6ef21b8baec7 100644
--- a/include/linux/platform_data/x86/pwm-lpss.h
+++ b/include/linux/platform_data/x86/pwm-lpss.h
@@ -4,6 +4,8 @@
#ifndef __PLATFORM_DATA_X86_PWM_LPSS_H
#define __PLATFORM_DATA_X86_PWM_LPSS_H
+#include <linux/err.h>
+#include <linux/kconfig.h>
#include <linux/types.h>
struct device;
@@ -27,7 +29,16 @@ struct pwm_lpss_boardinfo {
bool other_devices_aml_touches_pwm_regs;
};
+#if IS_REACHABLE(CONFIG_PWM_LPSS)
struct pwm_lpss_chip *devm_pwm_lpss_probe(struct device *dev, void __iomem *base,
const struct pwm_lpss_boardinfo *info);
+#else
+static inline
+struct pwm_lpss_chip *devm_pwm_lpss_probe(struct device *dev, void __iomem *base,
+ const struct pwm_lpss_boardinfo *info)
+{
+ return ERR_PTR(-ENODEV);
+}
+#endif /* CONFIG_PWM_LPSS */
#endif /* __PLATFORM_DATA_X86_PWM_LPSS_H */
--
2.35.1
Powered by blists - more mailing lists