return ret;
 }
 
-static int __init d40_of_probe(struct platform_device *pdev,
+static int __init d40_of_probe(struct device *dev,
                               struct device_node *np)
 {
        struct stedma40_platform_data *pdata;
        int num_phy = 0, num_memcpy = 0, num_disabled = 0;
        const __be32 *list;
 
-       pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+       pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
        if (!pdata)
                return -ENOMEM;
 
        num_memcpy /= sizeof(*list);
 
        if (num_memcpy > D40_MEMCPY_MAX_CHANS || num_memcpy <= 0) {
-               d40_err(&pdev->dev,
+               d40_err(dev,
                        "Invalid number of memcpy channels specified (%d)\n",
                        num_memcpy);
                return -EINVAL;
        num_disabled /= sizeof(*list);
 
        if (num_disabled >= STEDMA40_MAX_PHYS || num_disabled < 0) {
-               d40_err(&pdev->dev,
+               d40_err(dev,
                        "Invalid number of disabled channels specified (%d)\n",
                        num_disabled);
                return -EINVAL;
                                   num_disabled);
        pdata->disabled_channels[num_disabled] = -1;
 
-       pdev->dev.platform_data = pdata;
+       dev->platform_data = pdata;
 
        return 0;
 }
 static int __init d40_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       struct stedma40_platform_data *plat_data = dev_get_platdata(dev);
        struct device_node *np = pdev->dev.of_node;
        struct device_node *np_lcpa;
        int ret = -ENOENT;
        int num_reserved_chans;
        u32 val;
 
-       if (d40_of_probe(pdev, np)) {
+       if (d40_of_probe(dev, np)) {
                ret = -ENOMEM;
                goto report_failure;
        }