Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: ste_dma40: Pass dev to OF function

The OF platform data population function only wants to
use struct device *dev, so pass that instead.

This change makes the compiler realize that the local
platform data variable is unused, so drop that too.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230417-ux500-dma40-cleanup-v3-5-60bfa6785968@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Linus Walleij and committed by
Vinod Koul
e59d81e9 42ae6f16

+6 -7
+6 -7
drivers/dma/ste_dma40.c
··· 3480 3480 return ret; 3481 3481 } 3482 3482 3483 - static int __init d40_of_probe(struct platform_device *pdev, 3483 + static int __init d40_of_probe(struct device *dev, 3484 3484 struct device_node *np) 3485 3485 { 3486 3486 struct stedma40_platform_data *pdata; 3487 3487 int num_phy = 0, num_memcpy = 0, num_disabled = 0; 3488 3488 const __be32 *list; 3489 3489 3490 - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 3490 + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); 3491 3491 if (!pdata) 3492 3492 return -ENOMEM; 3493 3493 ··· 3500 3500 num_memcpy /= sizeof(*list); 3501 3501 3502 3502 if (num_memcpy > D40_MEMCPY_MAX_CHANS || num_memcpy <= 0) { 3503 - d40_err(&pdev->dev, 3503 + d40_err(dev, 3504 3504 "Invalid number of memcpy channels specified (%d)\n", 3505 3505 num_memcpy); 3506 3506 return -EINVAL; ··· 3515 3515 num_disabled /= sizeof(*list); 3516 3516 3517 3517 if (num_disabled >= STEDMA40_MAX_PHYS || num_disabled < 0) { 3518 - d40_err(&pdev->dev, 3518 + d40_err(dev, 3519 3519 "Invalid number of disabled channels specified (%d)\n", 3520 3520 num_disabled); 3521 3521 return -EINVAL; ··· 3526 3526 num_disabled); 3527 3527 pdata->disabled_channels[num_disabled] = -1; 3528 3528 3529 - pdev->dev.platform_data = pdata; 3529 + dev->platform_data = pdata; 3530 3530 3531 3531 return 0; 3532 3532 } ··· 3534 3534 static int __init d40_probe(struct platform_device *pdev) 3535 3535 { 3536 3536 struct device *dev = &pdev->dev; 3537 - struct stedma40_platform_data *plat_data = dev_get_platdata(dev); 3538 3537 struct device_node *np = pdev->dev.of_node; 3539 3538 struct device_node *np_lcpa; 3540 3539 int ret = -ENOENT; ··· 3543 3544 int num_reserved_chans; 3544 3545 u32 val; 3545 3546 3546 - if (d40_of_probe(pdev, np)) { 3547 + if (d40_of_probe(dev, np)) { 3547 3548 ret = -ENOMEM; 3548 3549 goto report_failure; 3549 3550 }