static int rcar_vin_remove(struct platform_device *pdev) { struct rvin_dev *vin = platform_get_drvdata(pdev); pm_runtime_disable(&pdev->dev); v4l2_async_notifier_unregister(&vin->notifier); rvin_dma_remove(vin); return 0; }
static int rcar_vin_probe(struct platform_device *pdev) { const struct of_device_id *match; struct rvin_dev *vin; struct resource *mem; int irq, ret; vin = devm_kzalloc(&pdev->dev, sizeof(*vin), GFP_KERNEL); if (!vin) return -ENOMEM; match = of_match_device(of_match_ptr(rvin_of_id_table), &pdev->dev); if (!match) return -ENODEV; vin->dev = &pdev->dev; vin->chip = (enum chip_id)match->data; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (mem == NULL) return -EINVAL; vin->base = devm_ioremap_resource(vin->dev, mem); if (IS_ERR(vin->base)) return PTR_ERR(vin->base); irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; ret = rvin_dma_probe(vin, irq); if (ret) return ret; ret = rvin_digital_graph_init(vin); if (ret < 0) goto error; pm_suspend_ignore_children(&pdev->dev, true); pm_runtime_enable(&pdev->dev); platform_set_drvdata(pdev, vin); return 0; error: rvin_dma_remove(vin); return ret; }
static int rcar_vin_probe(struct platform_device *pdev) { struct rvin_dev *vin; struct resource *mem; int irq, ret; vin = devm_kzalloc(&pdev->dev, sizeof(*vin), GFP_KERNEL); if (!vin) return -ENOMEM; vin->dev = &pdev->dev; ret = rvin_parse_dt(vin); if (ret) return ret; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (mem == NULL) return -EINVAL; vin->base = devm_ioremap_resource(vin->dev, mem); if (IS_ERR(vin->base)) return PTR_ERR(vin->base); irq = platform_get_irq(pdev, 0); if (irq <= 0) return ret; ret = rvin_dma_probe(vin, irq); if (ret) return ret; ret = rvin_graph_init(vin); if (ret < 0) goto error; pm_suspend_ignore_children(&pdev->dev, true); pm_runtime_enable(&pdev->dev); platform_set_drvdata(pdev, vin); return 0; error: rvin_dma_remove(vin); return ret; }