Skip to content

Commit e59d81e

Browse files
Linus Walleijvinodkoul
authored andcommitted
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>
1 parent 42ae6f1 commit e59d81e

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

drivers/dma/ste_dma40.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3480,14 +3480,14 @@ static int __init d40_lcla_allocate(struct d40_base *base)
34803480
return ret;
34813481
}
34823482

3483-
static int __init d40_of_probe(struct platform_device *pdev,
3483+
static int __init d40_of_probe(struct device *dev,
34843484
struct device_node *np)
34853485
{
34863486
struct stedma40_platform_data *pdata;
34873487
int num_phy = 0, num_memcpy = 0, num_disabled = 0;
34883488
const __be32 *list;
34893489

3490-
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
3490+
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
34913491
if (!pdata)
34923492
return -ENOMEM;
34933493

@@ -3500,7 +3500,7 @@ static int __init d40_of_probe(struct platform_device *pdev,
35003500
num_memcpy /= sizeof(*list);
35013501

35023502
if (num_memcpy > D40_MEMCPY_MAX_CHANS || num_memcpy <= 0) {
3503-
d40_err(&pdev->dev,
3503+
d40_err(dev,
35043504
"Invalid number of memcpy channels specified (%d)\n",
35053505
num_memcpy);
35063506
return -EINVAL;
@@ -3515,7 +3515,7 @@ static int __init d40_of_probe(struct platform_device *pdev,
35153515
num_disabled /= sizeof(*list);
35163516

35173517
if (num_disabled >= STEDMA40_MAX_PHYS || num_disabled < 0) {
3518-
d40_err(&pdev->dev,
3518+
d40_err(dev,
35193519
"Invalid number of disabled channels specified (%d)\n",
35203520
num_disabled);
35213521
return -EINVAL;
@@ -3526,15 +3526,14 @@ static int __init d40_of_probe(struct platform_device *pdev,
35263526
num_disabled);
35273527
pdata->disabled_channels[num_disabled] = -1;
35283528

3529-
pdev->dev.platform_data = pdata;
3529+
dev->platform_data = pdata;
35303530

35313531
return 0;
35323532
}
35333533

35343534
static int __init d40_probe(struct platform_device *pdev)
35353535
{
35363536
struct device *dev = &pdev->dev;
3537-
struct stedma40_platform_data *plat_data = dev_get_platdata(dev);
35383537
struct device_node *np = pdev->dev.of_node;
35393538
struct device_node *np_lcpa;
35403539
int ret = -ENOENT;
@@ -3544,7 +3543,7 @@ static int __init d40_probe(struct platform_device *pdev)
35443543
int num_reserved_chans;
35453544
u32 val;
35463545

3547-
if (d40_of_probe(pdev, np)) {
3546+
if (d40_of_probe(dev, np)) {
35483547
ret = -ENOMEM;
35493548
goto report_failure;
35503549
}

0 commit comments

Comments
 (0)