Message ID | 20230718150657.1728166-1-u.kleine-koenig@pengutronix.de |
---|---|
State | Accepted |
Headers | show |
Series | pwm: pxa: Don't reimplement of_device_get_match_data() | expand |
On Tue, 18 Jul 2023 17:06:57 +0200, Uwe Kleine-König wrote: > Apart from the return type pxa_pwm_get_id_dt() reimplements > of_device_get_match_data(). Drop the former and replace the call to it > by the latter. > > Applied, thanks! [1/1] pwm: pxa: Don't reimplement of_device_get_match_data() commit: 63808bbb3e226b0160f61723614e612fbf51541c Best regards,
diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c index 762429d5647f..57e0f7b58b3a 100644 --- a/drivers/pwm/pwm-pxa.c +++ b/drivers/pwm/pwm-pxa.c @@ -156,13 +156,6 @@ MODULE_DEVICE_TABLE(of, pwm_of_match); #define pwm_of_match NULL #endif -static const struct platform_device_id *pxa_pwm_get_id_dt(struct device *dev) -{ - const struct of_device_id *id = of_match_device(pwm_of_match, dev); - - return id ? id->data : NULL; -} - static int pwm_probe(struct platform_device *pdev) { const struct platform_device_id *id = platform_get_device_id(pdev); @@ -170,7 +163,7 @@ static int pwm_probe(struct platform_device *pdev) int ret = 0; if (IS_ENABLED(CONFIG_OF) && id == NULL) - id = pxa_pwm_get_id_dt(&pdev->dev); + id = of_device_get_match_data(&pdev->dev); if (id == NULL) return -EINVAL;
Apart from the return type pxa_pwm_get_id_dt() reimplements of_device_get_match_data(). Drop the former and replace the call to it by the latter. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/pwm/pwm-pxa.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5