mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
pwm: pxa: Don't reimplement of_device_get_match_data()
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> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
4aed0ccd68
commit
63808bbb3e
|
|
@ -157,13 +157,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);
|
||||
|
|
@ -171,7 +164,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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user