[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221110073831.ggudvgl6jzgbo2vb@pengutronix.de>
Date: Thu, 10 Nov 2022 08:38:31 +0100
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Mika Westerberg <mika.westerberg@...ux.intel.com>,
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, Andy Shevchenko <andy@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH v2 5/6] pwm: lpss: Add pwm_lpss_probe() stub
On Tue, Nov 08, 2022 at 04:22:25PM +0200, Andy Shevchenko wrote:
> In case the PWM LPSS module is not provided, allow users to be
> compiled with a help of a pwm_lpss_probe() stub.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.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 296bd837ddbb..c868b396ed2c 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 *pwm_lpss_probe(struct device *dev, void __iomem *base,
> const struct pwm_lpss_boardinfo *info);
> +#else
> +static inline
> +struct pwm_lpss_chip *pwm_lpss_probe(struct device *dev, void __iomem *base,
> + const struct pwm_lpss_boardinfo *info)
> +{
> + return ERR_PTR(-ENODEV);
Would it be more consistent to return the same value as the pwmchip_add
stub does?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists