Message ID | 20250214163442.192006-2-u.kleine-koenig@baylibre.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | pwm: clps711x: Drop of_match_ptr() usage for .of_match_table | expand |
On Fri, Feb 14, 2025 at 05:34:42PM +0100, Uwe Kleine-König wrote: > The pwm-clps711x driver depends on ARCH_CLPS711X || COMPILE_TEST. With > the former being an ARCH_MULTI_V4T platform, there is always OF=y when > ARCH_CLPS711X=y, so in practise clps711x_pwm_dt_ids[] is always used. > (And in the case COMPILE_TEST=y + OF=n this only increases the driver > size a bit but still compiles.) > > So drop the usage of of_match_ptr(). FWIW, Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Note, that those macros, of_match_ptr() and ACPI_PTR(), more harmful then helpful. If you look at the history of the project, you may find many patches that were fixing compilation warnings of unused variables or so due to (mis)uses of those macros.
Hello, On Fri, Feb 14, 2025 at 05:34:42PM +0100, Uwe Kleine-König wrote: > The pwm-clps711x driver depends on ARCH_CLPS711X || COMPILE_TEST. With > the former being an ARCH_MULTI_V4T platform, there is always OF=y when > ARCH_CLPS711X=y, so in practise clps711x_pwm_dt_ids[] is always used. > (And in the case COMPILE_TEST=y + OF=n this only increases the driver > size a bit but still compiles.) > > So drop the usage of of_match_ptr(). > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> > --- Applied with Andy's Reviewed-by tag to https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next . Best regards Uwe
diff --git a/drivers/pwm/pwm-clps711x.c b/drivers/pwm/pwm-clps711x.c index c950e1dbd2b8..04559a9de718 100644 --- a/drivers/pwm/pwm-clps711x.c +++ b/drivers/pwm/pwm-clps711x.c @@ -98,7 +98,7 @@ static int clps711x_pwm_probe(struct platform_device *pdev) return devm_pwmchip_add(&pdev->dev, chip); } -static const struct of_device_id __maybe_unused clps711x_pwm_dt_ids[] = { +static const struct of_device_id clps711x_pwm_dt_ids[] = { { .compatible = "cirrus,ep7209-pwm", }, { } }; @@ -107,7 +107,7 @@ MODULE_DEVICE_TABLE(of, clps711x_pwm_dt_ids); static struct platform_driver clps711x_pwm_driver = { .driver = { .name = "clps711x-pwm", - .of_match_table = of_match_ptr(clps711x_pwm_dt_ids), + .of_match_table = clps711x_pwm_dt_ids, }, .probe = clps711x_pwm_probe, };
The pwm-clps711x driver depends on ARCH_CLPS711X || COMPILE_TEST. With the former being an ARCH_MULTI_V4T platform, there is always OF=y when ARCH_CLPS711X=y, so in practise clps711x_pwm_dt_ids[] is always used. (And in the case COMPILE_TEST=y + OF=n this only increases the driver size a bit but still compiles.) So drop the usage of of_match_ptr(). Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> --- Hello, inspired by Andy's patch that does a similar thing for pwm-pca9685; see https://lore.kernel.org/r/20250214154031.3395014-1-andriy.shevchenko@linux.intel.com. Best regards Uwe drivers/pwm/pwm-clps711x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b