mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-12 03:26:26 +00:00
pwm: atmel: Use of_device_get_match_data()
Use of_device_get_match_data() instead of an open-coded variant. Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
313b78efea
commit
017bb04e84
1 changed files with 2 additions and 9 deletions
|
@ -337,15 +337,8 @@ atmel_pwm_get_driver_data(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
const struct platform_device_id *id;
|
const struct platform_device_id *id;
|
||||||
|
|
||||||
if (pdev->dev.of_node) {
|
if (pdev->dev.of_node)
|
||||||
const struct of_device_id *match;
|
return of_device_get_match_data(&pdev->dev);
|
||||||
|
|
||||||
match = of_match_device(atmel_pwm_dt_ids, &pdev->dev);
|
|
||||||
if (!match)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
return match->data;
|
|
||||||
}
|
|
||||||
|
|
||||||
id = platform_get_device_id(pdev);
|
id = platform_get_device_id(pdev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue