platform.c (f8d9ddbc28518a0f7d39d2ce51f778759b49f73e) platform.c (a9c56721d6ae99b22e983d0722e6b1b53a11dd59)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Platform driver for the Synopsys DesignWare DMA Controller
4 *
5 * Copyright (C) 2007-2008 Atmel Corporation
6 * Copyright (C) 2010-2011 ST Microelectronics
7 * Copyright (C) 2013 Intel Corporation
8 *

--- 158 unchanged lines hidden (view full) ---

167#endif
168
169static int dw_probe(struct platform_device *pdev)
170{
171 const struct dw_dma_chip_pdata *match;
172 struct dw_dma_chip_pdata *data;
173 struct dw_dma_chip *chip;
174 struct device *dev = &pdev->dev;
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Platform driver for the Synopsys DesignWare DMA Controller
4 *
5 * Copyright (C) 2007-2008 Atmel Corporation
6 * Copyright (C) 2010-2011 ST Microelectronics
7 * Copyright (C) 2013 Intel Corporation
8 *

--- 158 unchanged lines hidden (view full) ---

167#endif
168
169static int dw_probe(struct platform_device *pdev)
170{
171 const struct dw_dma_chip_pdata *match;
172 struct dw_dma_chip_pdata *data;
173 struct dw_dma_chip *chip;
174 struct device *dev = &pdev->dev;
175 struct resource *mem;
176 int err;
177
178 match = device_get_match_data(dev);
179 if (!match)
180 return -ENODEV;
181
182 data = devm_kmemdup(&pdev->dev, match, sizeof(*match), GFP_KERNEL);
183 if (!data)
184 return -ENOMEM;
185
186 chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
187 if (!chip)
188 return -ENOMEM;
189
190 chip->irq = platform_get_irq(pdev, 0);
191 if (chip->irq < 0)
192 return chip->irq;
193
175 int err;
176
177 match = device_get_match_data(dev);
178 if (!match)
179 return -ENODEV;
180
181 data = devm_kmemdup(&pdev->dev, match, sizeof(*match), GFP_KERNEL);
182 if (!data)
183 return -ENOMEM;
184
185 chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
186 if (!chip)
187 return -ENOMEM;
188
189 chip->irq = platform_get_irq(pdev, 0);
190 if (chip->irq < 0)
191 return chip->irq;
192
194 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
195 chip->regs = devm_ioremap_resource(dev, mem);
193 chip->regs = devm_platform_ioremap_resource(pdev, 0);
196 if (IS_ERR(chip->regs))
197 return PTR_ERR(chip->regs);
198
199 err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
200 if (err)
201 return err;
202
203 if (!data->pdata)

--- 167 unchanged lines hidden ---
194 if (IS_ERR(chip->regs))
195 return PTR_ERR(chip->regs);
196
197 err = dma_coerce_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
198 if (err)
199 return err;
200
201 if (!data->pdata)

--- 167 unchanged lines hidden ---