static int vsp1_pm_runtime_suspend(struct device *dev)
{
- struct vsp1_device *vsp1 = dev_get_drvdata(dev);
-
- clk_disable_unprepare(vsp1->clock);
-
return 0;
}
struct vsp1_device *vsp1 = dev_get_drvdata(dev);
int ret;
- ret = clk_prepare_enable(vsp1->clock);
- if (ret < 0)
- return ret;
-
if (vsp1->info) {
ret = vsp1_device_init(vsp1);
- if (ret < 0) {
- clk_disable_unprepare(vsp1->clock);
+ if (ret < 0)
return ret;
- }
}
return 0;
platform_set_drvdata(pdev, vsp1);
- /* I/O, IRQ and clock resources */
+ /* I/O and IRQ resources (clock managed by the clock PM domain) */
io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
vsp1->mmio = devm_ioremap_resource(&pdev->dev, io);
if (IS_ERR(vsp1->mmio))
return PTR_ERR(vsp1->mmio);
- vsp1->clock = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(vsp1->clock)) {
- dev_err(&pdev->dev, "failed to get clock\n");
- return PTR_ERR(vsp1->clock);
- }
-
irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!irq) {
dev_err(&pdev->dev, "missing IRQ\n");