Commit a8d3584a authored by Russell King's avatar Russell King Committed by Russell King

[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: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent f47fc0ac
......@@ -58,17 +58,6 @@ void clk_disable(struct clk *clk)
}
EXPORT_SYMBOL(clk_disable);
int clk_use(struct clk *clk)
{
return 0;
}
EXPORT_SYMBOL(clk_use);
void clk_unuse(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_unuse);
unsigned long clk_get_rate(struct clk *clk)
{
return clk->rate;
......
......@@ -58,17 +58,6 @@ void clk_disable(struct clk *clk)
}
EXPORT_SYMBOL(clk_disable);
int clk_use(struct clk *clk)
{
return 0;
}
EXPORT_SYMBOL(clk_use);
void clk_unuse(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_unuse);
unsigned long clk_get_rate(struct clk *clk)
{
return clk->rate;
......
......@@ -57,17 +57,6 @@ void clk_disable(struct clk *clk)
}
EXPORT_SYMBOL(clk_disable);
int clk_use(struct clk *clk)
{
return 0;
}
EXPORT_SYMBOL(clk_use);
void clk_unuse(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_unuse);
unsigned long clk_get_rate(struct clk *clk)
{
return clk->rate;
......
......@@ -151,18 +151,6 @@ void clk_disable(struct clk *clk)
}
int clk_use(struct clk *clk)
{
atomic_inc(&clk->used);
return 0;
}
void clk_unuse(struct clk *clk)
{
atomic_dec(&clk->used);
}
unsigned long clk_get_rate(struct clk *clk)
{
if (IS_ERR(clk))
......@@ -196,8 +184,6 @@ EXPORT_SYMBOL(clk_get);
EXPORT_SYMBOL(clk_put);
EXPORT_SYMBOL(clk_enable);
EXPORT_SYMBOL(clk_disable);
EXPORT_SYMBOL(clk_use);
EXPORT_SYMBOL(clk_unuse);
EXPORT_SYMBOL(clk_get_rate);
EXPORT_SYMBOL(clk_round_rate);
EXPORT_SYMBOL(clk_set_rate);
......@@ -370,7 +356,6 @@ static struct clk init_clocks[] = {
int s3c24xx_register_clock(struct clk *clk)
{
clk->owner = THIS_MODULE;
atomic_set(&clk->used, 0);
if (clk->enable == NULL)
clk->enable = clk_null_enable;
......
......@@ -16,7 +16,6 @@ struct clk {
struct clk *parent;
const char *name;
int id;
atomic_t used;
unsigned long rate;
unsigned long ctrlbit;
int (*enable)(struct clk *, int enable);
......
......@@ -191,7 +191,6 @@ static void s3c2410_timer_setup (void)
if (IS_ERR(clk))
panic("failed to get clock for system timer");
clk_use(clk);
clk_enable(clk);
pclk = clk_get_rate(clk);
......
......@@ -58,17 +58,6 @@ void clk_disable(struct clk *clk)
}
EXPORT_SYMBOL(clk_disable);
int clk_use(struct clk *clk)
{
return 0;
}
EXPORT_SYMBOL(clk_use);
void clk_unuse(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_unuse);
unsigned long clk_get_rate(struct clk *clk)
{
return clk->rate;
......
......@@ -397,7 +397,6 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
return -ENOENT;
}
clk_use(wdt_clock);
clk_enable(wdt_clock);
/* see if we can actually set the requested timer margin, and if
......@@ -444,7 +443,6 @@ static int s3c2410wdt_remove(struct platform_device *dev)
if (wdt_clock != NULL) {
clk_disable(wdt_clock);
clk_unuse(wdt_clock);
clk_put(wdt_clock);
wdt_clock = NULL;
}
......
......@@ -738,7 +738,6 @@ static void s3c24xx_i2c_free(struct s3c24xx_i2c *i2c)
{
if (i2c->clk != NULL && !IS_ERR(i2c->clk)) {
clk_disable(i2c->clk);
clk_unuse(i2c->clk);
clk_put(i2c->clk);
i2c->clk = NULL;
}
......@@ -778,7 +777,6 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "clock source %p\n", i2c->clk);
clk_use(i2c->clk);
clk_enable(i2c->clk);
/* map the registers */
......
......@@ -72,13 +72,9 @@ static int amba_kmi_open(struct serio *io)
unsigned int divisor;
int ret;
ret = clk_use(kmi->clk);
if (ret)
goto out;
ret = clk_enable(kmi->clk);
if (ret)
goto clk_unuse;
goto out;
divisor = clk_get_rate(kmi->clk) / 8000000 - 1;
writeb(divisor, KMICLKDIV);
......@@ -97,8 +93,6 @@ static int amba_kmi_open(struct serio *io)
clk_disable:
clk_disable(kmi->clk);
clk_unuse:
clk_unuse(kmi->clk);
out:
return ret;
}
......@@ -111,7 +105,6 @@ static void amba_kmi_close(struct serio *io)
free_irq(kmi->irq, kmi);
clk_disable(kmi->clk);
clk_unuse(kmi->clk);
}
static int amba_kmi_probe(struct amba_device *dev, void *id)
......
......@@ -479,13 +479,9 @@ static int mmci_probe(struct amba_device *dev, void *id)
goto host_free;
}
ret = clk_use(host->clk);
if (ret)
goto clk_free;
ret = clk_enable(host->clk);
if (ret)
goto clk_unuse;
goto clk_free;
host->plat = plat;
host->mclk = clk_get_rate(host->clk);
......@@ -558,8 +554,6 @@ static int mmci_probe(struct amba_device *dev, void *id)
iounmap(host->base);
clk_disable:
clk_disable(host->clk);
clk_unuse:
clk_unuse(host->clk);
clk_free:
clk_put(host->clk);
host_free:
......@@ -594,7 +588,6 @@ static int mmci_remove(struct amba_device *dev)
iounmap(host->base);
clk_disable(host->clk);
clk_unuse(host->clk);
clk_put(host->clk);
mmc_free_host(mmc);
......
......@@ -460,7 +460,6 @@ static int s3c2410_nand_remove(struct platform_device *pdev)
if (info->clk != NULL && !IS_ERR(info->clk)) {
clk_disable(info->clk);
clk_unuse(info->clk);
clk_put(info->clk);
}
......@@ -598,7 +597,6 @@ static int s3c24xx_nand_probe(struct platform_device *pdev, int is_s3c2440)
goto exit_error;
}
clk_use(info->clk);
clk_enable(info->clk);
/* allocate and map the resource */
......
......@@ -761,10 +761,6 @@ static int pl011_probe(struct amba_device *dev, void *id)
goto unmap;
}
ret = clk_use(uap->clk);
if (ret)
goto putclk;
uap->port.dev = &dev->dev;
uap->port.mapbase = dev->res.start;
uap->port.membase = base;
......@@ -782,8 +778,6 @@ static int pl011_probe(struct amba_device *dev, void *id)
if (ret) {
amba_set_drvdata(dev, NULL);
amba_ports[i] = NULL;
clk_unuse(uap->clk);
putclk:
clk_put(uap->clk);
unmap:
iounmap(base);
......@@ -808,7 +802,6 @@ static int pl011_remove(struct amba_device *dev)
amba_ports[i] = NULL;
iounmap(uap->port.membase);
clk_unuse(uap->clk);
clk_put(uap->clk);
kfree(uap);
return 0;
......
......@@ -782,11 +782,9 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
if (ourport->baudclk != NULL && !IS_ERR(ourport->baudclk)) {
clk_disable(ourport->baudclk);
clk_unuse(ourport->baudclk);
ourport->baudclk = NULL;
}
clk_use(clk);
clk_enable(clk);
ourport->clksrc = clksrc;
......@@ -1077,9 +1075,6 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
ourport->clk = clk_get(&platdev->dev, "uart");
if (ourport->clk != NULL && !IS_ERR(ourport->clk))
clk_use(ourport->clk);
dbg("port: map=%08x, mem=%08x, irq=%d, clock=%ld\n",
port->mapbase, port->membase, port->irq, port->uartclk);
......
......@@ -363,7 +363,6 @@ int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
goto err1;
}
clk_use(clk);
s3c2410_start_hc(dev, hcd);
hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
......@@ -384,7 +383,6 @@ int usb_hcd_s3c2410_probe (const struct hc_driver *driver,
err2:
s3c2410_stop_hc(dev);
iounmap(hcd->regs);
clk_unuse(clk);
clk_put(clk);
err1:
......
......@@ -346,10 +346,6 @@ static int clcdfb_register(struct clcd_fb *fb)
goto out;
}
ret = clk_use(fb->clk);
if (ret)
goto free_clk;
fb->fb.fix.mmio_start = fb->dev->res.start;
fb->fb.fix.mmio_len = SZ_4K;
......@@ -357,7 +353,7 @@ static int clcdfb_register(struct clcd_fb *fb)
if (!fb->regs) {
printk(KERN_ERR "CLCD: unable to remap registers\n");
ret = -ENOMEM;
goto unuse_clk;
goto free_clk;
}
fb->fb.fbops = &clcdfb_ops;
......@@ -427,8 +423,6 @@ static int clcdfb_register(struct clcd_fb *fb)
printk(KERN_ERR "CLCD: cannot register framebuffer (%d)\n", ret);
iounmap(fb->regs);
unuse_clk:
clk_unuse(fb->clk);
free_clk:
clk_put(fb->clk);
out:
......@@ -489,7 +483,6 @@ static int clcdfb_remove(struct amba_device *dev)
clcdfb_disable(fb);
unregister_framebuffer(&fb->fb);
iounmap(fb->regs);
clk_unuse(fb->clk);
clk_put(fb->clk);
fb->board->remove(fb);
......
......@@ -746,7 +746,6 @@ int __init s3c2410fb_probe(struct platform_device *pdev)
goto release_irq;
}
clk_use(info->clk);
clk_enable(info->clk);
dprintk("got and enabled clock\n");
......@@ -783,7 +782,6 @@ int __init s3c2410fb_probe(struct platform_device *pdev)
s3c2410fb_unmap_video_memory(info);
release_clock:
clk_disable(info->clk);
clk_unuse(info->clk);
clk_put(info->clk);
release_irq:
free_irq(irq,info);
......@@ -828,7 +826,6 @@ static int s3c2410fb_remove(struct platform_device *pdev)
if (info->clk) {
clk_disable(info->clk);
clk_unuse(info->clk);
clk_put(info->clk);
info->clk = NULL;
}
......
......@@ -62,20 +62,6 @@ int clk_enable(struct clk *clk);
*/
void clk_disable(struct clk *clk);
/**
* clk_use - increment the use count
* @clk: clock source
*
* Returns success (0) or negative errno.
*/
int clk_use(struct clk *clk);
/**
* clk_unuse - decrement the use count
* @clk: clock source
*/
void clk_unuse(struct clk *clk);
/**
* clk_get_rate - obtain the current clock rate (in Hz) for a clock source.
* This is only valid once the clock source has been enabled.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment