struct atmel_isi *isi = ici->priv;
int ret;
- ret = clk_enable(isi->pclk);
+ ret = clk_prepare_enable(isi->pclk);
if (ret)
return ret;
- ret = clk_enable(isi->mck);
+ ret = clk_prepare_enable(isi->mck);
if (ret) {
- clk_disable(isi->pclk);
+ clk_disable_unprepare(isi->pclk);
return ret;
}
{
struct atmel_isi *isi = ici->priv;
- clk_disable(isi->mck);
- clk_disable(isi->pclk);
+ clk_disable_unprepare(isi->mck);
+ clk_disable_unprepare(isi->pclk);
}
static unsigned int isi_camera_poll(struct file *file, poll_table *pt)
isi->p_fb_descriptors,
isi->fb_descriptors_phys);
- clk_unprepare(isi->mck);
- clk_unprepare(isi->pclk);
-
return 0;
}
if (IS_ERR(isi->pclk))
return PTR_ERR(isi->pclk);
- ret = clk_prepare(isi->pclk);
- if (ret)
- return ret;
-
isi->pdata = pdata;
isi->active = NULL;
spin_lock_init(&isi->lock);
isi->mck = devm_clk_get(dev, "isi_mck");
if (IS_ERR(isi->mck)) {
dev_err(dev, "Failed to get isi_mck\n");
- ret = PTR_ERR(isi->mck);
- goto err_clk_get_mck;
+ return PTR_ERR(isi->mck);
}
- ret = clk_prepare(isi->mck);
- if (ret)
- goto err_clk_prepare_mck;
-
/* Set ISI_MCK's frequency, it should be faster than pixel clock */
ret = clk_set_rate(isi->mck, pdata->mck_hz);
if (ret < 0)
- goto err_set_mck_rate;
+ return ret;
isi->p_fb_descriptors = dma_alloc_coherent(&pdev->dev,
sizeof(struct fbd) * MAX_BUFFER_NUM,
&isi->fb_descriptors_phys,
GFP_KERNEL);
if (!isi->p_fb_descriptors) {
- ret = -ENOMEM;
dev_err(&pdev->dev, "Can't allocate descriptors!\n");
- goto err_alloc_descriptors;
+ return -ENOMEM;
}
for (i = 0; i < MAX_BUFFER_NUM; i++) {
sizeof(struct fbd) * MAX_BUFFER_NUM,
isi->p_fb_descriptors,
isi->fb_descriptors_phys);
-err_alloc_descriptors:
-err_set_mck_rate:
- clk_unprepare(isi->mck);
-err_clk_prepare_mck:
-err_clk_get_mck:
- clk_unprepare(isi->pclk);
return ret;
}