diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-01-03 13:41:37 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-03 13:41:37 -0500 |
commit | a8d3584a2df28827094f6338cde1303c467bc1f0 (patch) | |
tree | d2cdb824f4b2f109ad6a74285455b56e5a2dd118 /drivers | |
parent | f47fc0ac7ead5ed91a11fcabfad6ee44c17ee934 (diff) |
[ARM] Remove clk_use()/clk_unuse()
It seems that clk_use() and clk_unuse() are additional complexity
which isn't required anymore. Remove them from the clock framework
to avoid the additional confusion which they cause, and update all
ARM machine types except for OMAP.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/watchdog/s3c2410_wdt.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-s3c2410.c | 2 | ||||
-rw-r--r-- | drivers/input/serio/ambakmi.c | 9 | ||||
-rw-r--r-- | drivers/mmc/mmci.c | 9 | ||||
-rw-r--r-- | drivers/mtd/nand/s3c2410.c | 2 | ||||
-rw-r--r-- | drivers/serial/amba-pl011.c | 7 | ||||
-rw-r--r-- | drivers/serial/s3c2410.c | 5 | ||||
-rw-r--r-- | drivers/usb/host/ohci-s3c2410.c | 2 | ||||
-rw-r--r-- | drivers/video/amba-clcd.c | 9 | ||||
-rw-r--r-- | drivers/video/s3c2410fb.c | 3 |
10 files changed, 3 insertions, 47 deletions
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c index eb667daee19b..621e8a99e733 100644 --- a/drivers/char/watchdog/s3c2410_wdt.c +++ b/drivers/char/watchdog/s3c2410_wdt.c | |||
@@ -397,7 +397,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev) | |||
397 | return -ENOENT; | 397 | return -ENOENT; |
398 | } | 398 | } |
399 | 399 | ||
400 | clk_use(wdt_clock); | ||
401 | clk_enable(wdt_clock); | 400 | clk_enable(wdt_clock); |
402 | 401 | ||
403 | /* see if we can actually set the requested timer margin, and if | 402 | /* see if we can actually set the requested timer margin, and if |
@@ -444,7 +443,6 @@ static int s3c2410wdt_remove(struct platform_device *dev) | |||
444 | 443 | ||
445 | if (wdt_clock != NULL) { | 444 | if (wdt_clock != NULL) { |
446 | clk_disable(wdt_clock); | 445 | clk_disable(wdt_clock); |
447 | clk_unuse(wdt_clock); | ||
448 | clk_put(wdt_clock); | 446 | clk_put(wdt_clock); |
449 | wdt_clock = NULL; | 447 | wdt_clock = NULL; |
450 | } | 448 | } |
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 58cfd3111ef6..2a2f86d8c2d8 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -738,7 +738,6 @@ static void s3c24xx_i2c_free(struct s3c24xx_i2c *i2c) | |||
738 | { | 738 | { |
739 | if (i2c->clk != NULL && !IS_ERR(i2c->clk)) { | 739 | if (i2c->clk != NULL && !IS_ERR(i2c->clk)) { |
740 | clk_disable(i2c->clk); | 740 | clk_disable(i2c->clk); |
741 | clk_unuse(i2c->clk); | ||
742 | clk_put(i2c->clk); | 741 | clk_put(i2c->clk); |
743 | i2c->clk = NULL; | 742 | i2c->clk = NULL; |
744 | } | 743 | } |
@@ -778,7 +777,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) | |||
778 | 777 | ||
779 | dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk); | 778 | dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk); |
780 | 779 | ||
781 | clk_use(i2c->clk); | ||
782 | clk_enable(i2c->clk); | 780 | clk_enable(i2c->clk); |
783 | 781 | ||
784 | /* map the registers */ | 782 | /* map the registers */ |
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index 9b1ab5e7a98d..d847ed51cfb1 100644 --- a/drivers/input/serio/ambakmi.c +++ b/drivers/input/serio/ambakmi.c | |||
@@ -72,13 +72,9 @@ static int amba_kmi_open(struct serio *io) | |||
72 | unsigned int divisor; | 72 | unsigned int divisor; |
73 | int ret; | 73 | int ret; |
74 | 74 | ||
75 | ret = clk_use(kmi->clk); | ||
76 | if (ret) | ||
77 | goto out; | ||
78 | |||
79 | ret = clk_enable(kmi->clk); | 75 | ret = clk_enable(kmi->clk); |
80 | if (ret) | 76 | if (ret) |
81 | goto clk_unuse; | 77 | goto out; |
82 | 78 | ||
83 | divisor = clk_get_rate(kmi->clk) / 8000000 - 1; | 79 | divisor = clk_get_rate(kmi->clk) / 8000000 - 1; |
84 | writeb(divisor, KMICLKDIV); | 80 | writeb(divisor, KMICLKDIV); |
@@ -97,8 +93,6 @@ static int amba_kmi_open(struct serio *io) | |||
97 | 93 | ||
98 | clk_disable: | 94 | clk_disable: |
99 | clk_disable(kmi->clk); | 95 | clk_disable(kmi->clk); |
100 | clk_unuse: | ||
101 | clk_unuse(kmi->clk); | ||
102 | out: | 96 | out: |
103 | return ret; | 97 | return ret; |
104 | } | 98 | } |
@@ -111,7 +105,6 @@ static void amba_kmi_close(struct serio *io) | |||
111 | 105 | ||
112 | free_irq(kmi->irq, kmi); | 106 | free_irq(kmi->irq, kmi); |
113 | clk_disable(kmi->clk); | 107 | clk_disable(kmi->clk); |
114 | clk_unuse(kmi->clk); | ||
115 | } | 108 | } |
116 | 109 | ||
117 | static int amba_kmi_probe(struct amba_device *dev, void *id) | 110 | static int amba_kmi_probe(struct amba_device *dev, void *id) |
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c index 166c9b0ad04e..31b0b6d612bf 100644 --- a/drivers/mmc/mmci.c +++ b/drivers/mmc/mmci.c | |||
@@ -479,13 +479,9 @@ static int mmci_probe(struct amba_device *dev, void *id) | |||
479 | goto host_free; | 479 | goto host_free; |
480 | } | 480 | } |
481 | 481 | ||
482 | ret = clk_use(host->clk); | ||
483 | if (ret) | ||
484 | goto clk_free; | ||
485 | |||
486 | ret = clk_enable(host->clk); | 482 | ret = clk_enable(host->clk); |
487 | if (ret) | 483 | if (ret) |
488 | goto clk_unuse; | 484 | goto clk_free; |
489 | 485 | ||
490 | host->plat = plat; | 486 | host->plat = plat; |
491 | host->mclk = clk_get_rate(host->clk); | 487 | host->mclk = clk_get_rate(host->clk); |
@@ -558,8 +554,6 @@ static int mmci_probe(struct amba_device *dev, void *id) | |||
558 | iounmap(host->base); | 554 | iounmap(host->base); |
559 | clk_disable: | 555 | clk_disable: |
560 | clk_disable(host->clk); | 556 | clk_disable(host->clk); |
561 | clk_unuse: | ||
562 | clk_unuse(host->clk); | ||
563 | clk_free: | 557 | clk_free: |
564 | clk_put(host->clk); | 558 | clk_put(host->clk); |
565 | host_free: | 559 | host_free: |
@@ -594,7 +588,6 @@ static int mmci_remove(struct amba_device *dev) | |||
594 | 588 | ||
595 | iounmap(host->base); | 589 | iounmap(host->base); |
596 | clk_disable(host->clk); | 590 | clk_disable(host->clk); |
597 | clk_unuse(host->clk); | ||
598 | clk_put(host->clk); | 591 | clk_put(host->clk); |
599 | 592 | ||
600 | mmc_free_host(mmc); | 593 | mmc_free_host(mmc); |
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index d209214b1318..b796a9a6b924 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
@@ -460,7 +460,6 @@ static int s3c2410_nand_remove(struct platform_device *pdev) | |||
460 | 460 | ||
461 | if (info->clk != NULL && !IS_ERR(info->clk)) { | 461 | if (info->clk != NULL && !IS_ERR(info->clk)) { |
462 | clk_disable(info->clk); | 462 | clk_disable(info->clk); |
463 | clk_unuse(info->clk); | ||
464 | clk_put(info->clk); | 463 | clk_put(info->clk); |
465 | } | 464 | } |
466 | 465 | ||
@@ -598,7 +597,6 @@ static int s3c24xx_nand_probe(struct platform_device *pdev, int is_s3c2440) | |||
598 | goto exit_error; | 597 | goto exit_error; |
599 | } | 598 | } |
600 | 599 | ||
601 | clk_use(info->clk); | ||
602 | clk_enable(info->clk); | 600 | clk_enable(info->clk); |
603 | 601 | ||
604 | /* allocate and map the resource */ | 602 | /* allocate and map the resource */ |
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index d84476ee6592..531b0e4f25e5 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c | |||
@@ -761,10 +761,6 @@ static int pl011_probe(struct amba_device *dev, void *id) | |||
761 | goto unmap; | 761 | goto unmap; |
762 | } | 762 | } |
763 | 763 | ||
764 | ret = clk_use(uap->clk); | ||
765 | if (ret) | ||
766 | goto putclk; | ||
767 | |||
768 | uap->port.dev = &dev->dev; | 764 | uap->port.dev = &dev->dev; |
769 | uap->port.mapbase = dev->res.start; | 765 | uap->port.mapbase = dev->res.start; |
770 | uap->port.membase = base; | 766 | uap->port.membase = base; |
@@ -782,8 +778,6 @@ static int pl011_probe(struct amba_device *dev, void *id) | |||
782 | if (ret) { | 778 | if (ret) { |
783 | amba_set_drvdata(dev, NULL); | 779 | amba_set_drvdata(dev, NULL); |
784 | amba_ports[i] = NULL; | 780 | amba_ports[i] = NULL; |
785 | clk_unuse(uap->clk); | ||
786 | putclk: | ||
787 | clk_put(uap->clk); | 781 | clk_put(uap->clk); |
788 | unmap: | 782 | unmap: |
789 | iounmap(base); | 783 | iounmap(base); |
@@ -808,7 +802,6 @@ static int pl011_remove(struct amba_device *dev) | |||
808 | amba_ports[i] = NULL; | 802 | amba_ports[i] = NULL; |
809 | 803 | ||
810 | iounmap(uap->port.membase); | 804 | iounmap(uap->port.membase); |
811 | clk_unuse(uap->clk); | ||
812 | clk_put(uap->clk); | 805 | clk_put(uap->clk); |
813 | kfree(uap); | 806 | kfree(uap); |
814 | return 0; | 807 | return 0; |
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c index 47681c4654e4..eb47f5b71aeb 100644 --- a/drivers/serial/s3c2410.c +++ b/drivers/serial/s3c2410.c | |||
@@ -782,11 +782,9 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, | |||
782 | 782 | ||
783 | if (ourport->baudclk != NULL && !IS_ERR(ourport->baudclk)) { | 783 | if (ourport->baudclk != NULL && !IS_ERR(ourport->baudclk)) { |
784 | clk_disable(ourport->baudclk); | 784 | clk_disable(ourport->baudclk); |
785 | clk_unuse(ourport->baudclk); | ||
786 | ourport->baudclk = NULL; | 785 | ourport->baudclk = NULL; |
787 | } | 786 | } |
788 | 787 | ||
789 | clk_use(clk); | ||
790 | clk_enable(clk); | 788 | clk_enable(clk); |
791 | 789 | ||
792 | ourport->clksrc = clksrc; | 790 | ourport->clksrc = clksrc; |
@@ -1077,9 +1075,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, | |||
1077 | 1075 | ||
1078 | ourport->clk = clk_get(&platdev->dev, "uart"); | 1076 | ourport->clk = clk_get(&platdev->dev, "uart"); |
1079 | 1077 | ||
1080 | if (ourport->clk != NULL && !IS_ERR(ourport->clk)) | ||
1081 | clk_use(ourport->clk); | ||
1082 | |||
1083 | dbg("port: map=%08x, mem=%08x, irq=%d, clock=%ld\n", | 1078 | dbg("port: map=%08x, mem=%08x, irq=%d, clock=%ld\n", |
1084 | port->mapbase, port->membase, port->irq, port->uartclk); | 1079 | port->mapbase, port->membase, port->irq, port->uartclk); |
1085 | 1080 | ||
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 35cc9402adc0..add198a4be79 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c | |||
@@ -363,7 +363,6 @@ int usb_hcd_s3c2410_probe (const struct hc_driver *driver, | |||
363 | goto err1; | 363 | goto err1; |
364 | } | 364 | } |
365 | 365 | ||
366 | clk_use(clk); | ||
367 | s3c2410_start_hc(dev, hcd); | 366 | s3c2410_start_hc(dev, hcd); |
368 | 367 | ||
369 | hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); | 368 | hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len); |
@@ -384,7 +383,6 @@ int usb_hcd_s3c2410_probe (const struct hc_driver *driver, | |||
384 | err2: | 383 | err2: |
385 | s3c2410_stop_hc(dev); | 384 | s3c2410_stop_hc(dev); |
386 | iounmap(hcd->regs); | 385 | iounmap(hcd->regs); |
387 | clk_unuse(clk); | ||
388 | clk_put(clk); | 386 | clk_put(clk); |
389 | 387 | ||
390 | err1: | 388 | err1: |
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index a3c2c45e29e0..69421c86252c 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c | |||
@@ -346,10 +346,6 @@ static int clcdfb_register(struct clcd_fb *fb) | |||
346 | goto out; | 346 | goto out; |
347 | } | 347 | } |
348 | 348 | ||
349 | ret = clk_use(fb->clk); | ||
350 | if (ret) | ||
351 | goto free_clk; | ||
352 | |||
353 | fb->fb.fix.mmio_start = fb->dev->res.start; | 349 | fb->fb.fix.mmio_start = fb->dev->res.start; |
354 | fb->fb.fix.mmio_len = SZ_4K; | 350 | fb->fb.fix.mmio_len = SZ_4K; |
355 | 351 | ||
@@ -357,7 +353,7 @@ static int clcdfb_register(struct clcd_fb *fb) | |||
357 | if (!fb->regs) { | 353 | if (!fb->regs) { |
358 | printk(KERN_ERR "CLCD: unable to remap registers\n"); | 354 | printk(KERN_ERR "CLCD: unable to remap registers\n"); |
359 | ret = -ENOMEM; | 355 | ret = -ENOMEM; |
360 | goto unuse_clk; | 356 | goto free_clk; |
361 | } | 357 | } |
362 | 358 | ||
363 | fb->fb.fbops = &clcdfb_ops; | 359 | fb->fb.fbops = &clcdfb_ops; |
@@ -427,8 +423,6 @@ static int clcdfb_register(struct clcd_fb *fb) | |||
427 | printk(KERN_ERR "CLCD: cannot register framebuffer (%d)\n", ret); | 423 | printk(KERN_ERR "CLCD: cannot register framebuffer (%d)\n", ret); |
428 | 424 | ||
429 | iounmap(fb->regs); | 425 | iounmap(fb->regs); |
430 | unuse_clk: | ||
431 | clk_unuse(fb->clk); | ||
432 | free_clk: | 426 | free_clk: |
433 | clk_put(fb->clk); | 427 | clk_put(fb->clk); |
434 | out: | 428 | out: |
@@ -489,7 +483,6 @@ static int clcdfb_remove(struct amba_device *dev) | |||
489 | clcdfb_disable(fb); | 483 | clcdfb_disable(fb); |
490 | unregister_framebuffer(&fb->fb); | 484 | unregister_framebuffer(&fb->fb); |
491 | iounmap(fb->regs); | 485 | iounmap(fb->regs); |
492 | clk_unuse(fb->clk); | ||
493 | clk_put(fb->clk); | 486 | clk_put(fb->clk); |
494 | 487 | ||
495 | fb->board->remove(fb); | 488 | fb->board->remove(fb); |
diff --git a/drivers/video/s3c2410fb.c b/drivers/video/s3c2410fb.c index ce6e749db3a7..d9c08cc7ac44 100644 --- a/drivers/video/s3c2410fb.c +++ b/drivers/video/s3c2410fb.c | |||
@@ -746,7 +746,6 @@ int __init s3c2410fb_probe(struct platform_device *pdev) | |||
746 | goto release_irq; | 746 | goto release_irq; |
747 | } | 747 | } |
748 | 748 | ||
749 | clk_use(info->clk); | ||
750 | clk_enable(info->clk); | 749 | clk_enable(info->clk); |
751 | dprintk("got and enabled clock\n"); | 750 | dprintk("got and enabled clock\n"); |
752 | 751 | ||
@@ -783,7 +782,6 @@ free_video_memory: | |||
783 | s3c2410fb_unmap_video_memory(info); | 782 | s3c2410fb_unmap_video_memory(info); |
784 | release_clock: | 783 | release_clock: |
785 | clk_disable(info->clk); | 784 | clk_disable(info->clk); |
786 | clk_unuse(info->clk); | ||
787 | clk_put(info->clk); | 785 | clk_put(info->clk); |
788 | release_irq: | 786 | release_irq: |
789 | free_irq(irq,info); | 787 | free_irq(irq,info); |
@@ -828,7 +826,6 @@ static int s3c2410fb_remove(struct platform_device *pdev) | |||
828 | 826 | ||
829 | if (info->clk) { | 827 | if (info->clk) { |
830 | clk_disable(info->clk); | 828 | clk_disable(info->clk); |
831 | clk_unuse(info->clk); | ||
832 | clk_put(info->clk); | 829 | clk_put(info->clk); |
833 | info->clk = NULL; | 830 | info->clk = NULL; |
834 | } | 831 | } |