Skip to content

Commit 03652e0

Browse files
JoshWuMauro Carvalho Chehab
authored andcommitted
[media] V4L: atmel-isi: add clk_prepare()/clk_unprepare() functions
Signed-off-by: Josh Wu <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Guennadi Liakhovetski <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 7256522 commit 03652e0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/media/video/atmel-isi.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,9 @@ static int __devexit atmel_isi_remove(struct platform_device *pdev)
922922
isi->fb_descriptors_phys);
923923

924924
iounmap(isi->regs);
925+
clk_unprepare(isi->mck);
925926
clk_put(isi->mck);
927+
clk_unprepare(isi->pclk);
926928
clk_put(isi->pclk);
927929
kfree(isi);
928930

@@ -955,6 +957,10 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev)
955957
if (IS_ERR(pclk))
956958
return PTR_ERR(pclk);
957959

960+
ret = clk_prepare(pclk);
961+
if (ret)
962+
goto err_clk_prepare_pclk;
963+
958964
isi = kzalloc(sizeof(struct atmel_isi), GFP_KERNEL);
959965
if (!isi) {
960966
ret = -ENOMEM;
@@ -978,6 +984,10 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev)
978984
goto err_clk_get;
979985
}
980986

987+
ret = clk_prepare(isi->mck);
988+
if (ret)
989+
goto err_clk_prepare_mck;
990+
981991
/* Set ISI_MCK's frequency, it should be faster than pixel clock */
982992
ret = clk_set_rate(isi->mck, pdata->mck_hz);
983993
if (ret < 0)
@@ -1059,10 +1069,14 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev)
10591069
isi->fb_descriptors_phys);
10601070
err_alloc_descriptors:
10611071
err_set_mck_rate:
1072+
clk_unprepare(isi->mck);
1073+
err_clk_prepare_mck:
10621074
clk_put(isi->mck);
10631075
err_clk_get:
10641076
kfree(isi);
10651077
err_alloc_isi:
1078+
clk_unprepare(pclk);
1079+
err_clk_prepare_pclk:
10661080
clk_put(pclk);
10671081

10681082
return ret;

0 commit comments

Comments
 (0)