Message ID | 20250123101110.339337-5-u.kleine-koenig@baylibre.com |
---|---|
State | New |
Headers | show |
Series | pwm: lpss: module namespace fixes | expand |
Hello Andy, On Thu, Jan 23, 2025 at 01:45:17PM +0200, Andy Shevchenko wrote: > On Thu, Jan 23, 2025 at 12:11 PM Uwe Kleine-König > <u.kleine-koenig@baylibre.com> wrote: > > > > The intel pinctrl driver can provide a PWM device and for that needs to > > call the function devm_pwm_lpss_probe(). That function is provided by > > the pwm-lpss driver which intends to export it in the "PWM_LPSS" > > namespace. To prepare fixing the pwm-lpss driver to indeed use the > > "PWM_LPSS" namespace, import that namespace when used. > > ... > > > +#if IS_REACHABLE(CONFIG_PWM_LPSS) > > > +#endif > > Why? Because devm_pwm_lpss_probe() is only used #if IS_REACHABLE(CONFIG_PWM_LPSS). Without the #if but with https://lore.kernel.org/all/20250123110951.370759-2-u.kleine-koenig@baylibre.com/ this results in a warning (with W=1) :-) Best regards Uwe
On Thu, Jan 23, 2025 at 03:52:06PM +0100, Uwe Kleine-König wrote: > On Thu, Jan 23, 2025 at 01:45:17PM +0200, Andy Shevchenko wrote: > > On Thu, Jan 23, 2025 at 12:11 PM Uwe Kleine-König > > <u.kleine-koenig@baylibre.com> wrote: > > > > > > The intel pinctrl driver can provide a PWM device and for that needs to > > > call the function devm_pwm_lpss_probe(). That function is provided by > > > the pwm-lpss driver which intends to export it in the "PWM_LPSS" > > > namespace. To prepare fixing the pwm-lpss driver to indeed use the > > > "PWM_LPSS" namespace, import that namespace when used. ... > > > +#if IS_REACHABLE(CONFIG_PWM_LPSS) > > > > > +#endif > > > > Why? > > Because devm_pwm_lpss_probe() is only used #if > IS_REACHABLE(CONFIG_PWM_LPSS). Without the #if but with > https://lore.kernel.org/all/20250123110951.370759-2-u.kleine-koenig@baylibre.com/ > this results in a warning (with W=1) :-) There is no such commit in the current Linux Next, so let's solve the issues when they come up. I'm okay to take your series via Intel pin control without that ifdeffery. If you don't agree on the change, we need to find the way how to avoid ugly ifdeffery from day 1.
On Thu, Jan 23, 2025 at 05:48:17PM +0200, Andy Shevchenko wrote: > On Thu, Jan 23, 2025 at 03:52:06PM +0100, Uwe Kleine-König wrote: > > On Thu, Jan 23, 2025 at 01:45:17PM +0200, Andy Shevchenko wrote: > > > On Thu, Jan 23, 2025 at 12:11 PM Uwe Kleine-König > > > <u.kleine-koenig@baylibre.com> wrote: > > > > > > > > The intel pinctrl driver can provide a PWM device and for that needs to > > > > call the function devm_pwm_lpss_probe(). That function is provided by > > > > the pwm-lpss driver which intends to export it in the "PWM_LPSS" > > > > namespace. To prepare fixing the pwm-lpss driver to indeed use the > > > > "PWM_LPSS" namespace, import that namespace when used. > > ... > > > > > +#if IS_REACHABLE(CONFIG_PWM_LPSS) > > > > > > > +#endif > > > > > > Why? > > > > Because devm_pwm_lpss_probe() is only used #if > > IS_REACHABLE(CONFIG_PWM_LPSS). Without the #if but with > > https://lore.kernel.org/all/20250123110951.370759-2-u.kleine-koenig@baylibre.com/ > > this results in a warning (with W=1) :-) > > There is no such commit in the current Linux Next, so let's solve the issues > when they come up. > > I'm okay to take your series via Intel pin control without that ifdeffery. > If you don't agree on the change, we need to find the way how to avoid ugly > ifdeffery from day 1. I'm ok with dropping the #if. Should I resend or do you want to edit the patch? Would you take both patches then? Best regards Uwe
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index 527e4b87ae52..d7f1ebb1919f 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -1941,3 +1941,6 @@ MODULE_AUTHOR("Mathias Nyman <mathias.nyman@linux.intel.com>"); MODULE_AUTHOR("Mika Westerberg <mika.westerberg@linux.intel.com>"); MODULE_DESCRIPTION("Intel pinctrl/GPIO core driver"); MODULE_LICENSE("GPL v2"); +#if IS_REACHABLE(CONFIG_PWM_LPSS) +MODULE_IMPORT_NS("PWM_LPSS"); +#endif
The intel pinctrl driver can provide a PWM device and for that needs to call the function devm_pwm_lpss_probe(). That function is provided by the pwm-lpss driver which intends to export it in the "PWM_LPSS" namespace. To prepare fixing the pwm-lpss driver to indeed use the "PWM_LPSS" namespace, import that namespace when used. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> --- drivers/pinctrl/intel/pinctrl-intel.c | 3 +++ 1 file changed, 3 insertions(+)