const struct platform_device_id *id = platform_get_device_id(pdev);
struct resource *res;
struct ssp_device *ssp;
+ struct device *dev = &pdev->dev;
int ret = 0;
ssp = kzalloc(sizeof(struct ssp_device), GFP_KERNEL);
ssp->pdev = pdev;
- ssp->clk = clk_get(&pdev->dev, NULL);
+ ssp->clk = clk_get(dev, NULL);
if (IS_ERR(ssp->clk)) {
ret = PTR_ERR(ssp->clk);
goto err_free;
res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
if (res == NULL) {
- dev_err(&pdev->dev, "no SSP RX DRCMR defined\n");
+ dev_err(dev, "no SSP RX DRCMR defined\n");
ret = -ENODEV;
goto err_free_clk;
}
res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
if (res == NULL) {
- dev_err(&pdev->dev, "no SSP TX DRCMR defined\n");
+ dev_err(dev, "no SSP TX DRCMR defined\n");
ret = -ENODEV;
goto err_free_clk;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) {
- dev_err(&pdev->dev, "no memory resource defined\n");
+ dev_err(dev, "no memory resource defined\n");
ret = -ENODEV;
goto err_free_clk;
}
res = request_mem_region(res->start, resource_size(res),
pdev->name);
if (res == NULL) {
- dev_err(&pdev->dev, "failed to request memory resource\n");
+ dev_err(dev, "failed to request memory resource\n");
ret = -EBUSY;
goto err_free_clk;
}
ssp->mmio_base = ioremap(res->start, resource_size(res));
if (ssp->mmio_base == NULL) {
- dev_err(&pdev->dev, "failed to ioremap() registers\n");
+ dev_err(dev, "failed to ioremap() registers\n");
ret = -ENODEV;
goto err_free_mem;
}
ssp->irq = platform_get_irq(pdev, 0);
if (ssp->irq < 0) {
- dev_err(&pdev->dev, "no IRQ resource defined\n");
+ dev_err(dev, "no IRQ resource defined\n");
ret = -ENODEV;
goto err_free_io;
}