mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
i2c-s3c2410: Change IRQ to be plain integer.
Change the code to use a plain integer as the holder for the IRQ for the device and use platform_get_irq() to find it. This makes the code slightly neater, and easier to get the IRQ number. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
This commit is contained in:
parent
692acbd3a8
commit
e0d1ec9785
1 changed files with 8 additions and 14 deletions
|
@ -61,6 +61,7 @@ struct s3c24xx_i2c {
|
||||||
unsigned int msg_ptr;
|
unsigned int msg_ptr;
|
||||||
|
|
||||||
unsigned int tx_setup;
|
unsigned int tx_setup;
|
||||||
|
unsigned int irq;
|
||||||
|
|
||||||
enum s3c24xx_i2c_state state;
|
enum s3c24xx_i2c_state state;
|
||||||
unsigned long clkrate;
|
unsigned long clkrate;
|
||||||
|
@ -68,7 +69,6 @@ struct s3c24xx_i2c {
|
||||||
void __iomem *regs;
|
void __iomem *regs;
|
||||||
struct clk *clk;
|
struct clk *clk;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
struct resource *irq;
|
|
||||||
struct resource *ioarea;
|
struct resource *ioarea;
|
||||||
struct i2c_adapter adap;
|
struct i2c_adapter adap;
|
||||||
|
|
||||||
|
@ -869,26 +869,20 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
|
||||||
* ensure no current IRQs pending
|
* ensure no current IRQs pending
|
||||||
*/
|
*/
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
i2c->irq = ret = platform_get_irq(pdev, 0);
|
||||||
if (res == NULL) {
|
if (ret <= 0) {
|
||||||
dev_err(&pdev->dev, "cannot find IRQ\n");
|
dev_err(&pdev->dev, "cannot find IRQ\n");
|
||||||
ret = -ENOENT;
|
|
||||||
goto err_iomap;
|
goto err_iomap;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = request_irq(res->start, s3c24xx_i2c_irq, IRQF_DISABLED,
|
ret = request_irq(i2c->irq, s3c24xx_i2c_irq, IRQF_DISABLED,
|
||||||
pdev->name, i2c);
|
dev_name(&pdev->dev), i2c);
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
dev_err(&pdev->dev, "cannot claim IRQ\n");
|
dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq);
|
||||||
goto err_iomap;
|
goto err_iomap;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c->irq = res;
|
|
||||||
|
|
||||||
dev_dbg(&pdev->dev, "irq resource %p (%lu)\n", res,
|
|
||||||
(unsigned long)res->start);
|
|
||||||
|
|
||||||
ret = s3c24xx_i2c_register_cpufreq(i2c);
|
ret = s3c24xx_i2c_register_cpufreq(i2c);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(&pdev->dev, "failed to register cpufreq notifier\n");
|
dev_err(&pdev->dev, "failed to register cpufreq notifier\n");
|
||||||
|
@ -918,7 +912,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
|
||||||
s3c24xx_i2c_deregister_cpufreq(i2c);
|
s3c24xx_i2c_deregister_cpufreq(i2c);
|
||||||
|
|
||||||
err_irq:
|
err_irq:
|
||||||
free_irq(i2c->irq->start, i2c);
|
free_irq(i2c->irq, i2c);
|
||||||
|
|
||||||
err_iomap:
|
err_iomap:
|
||||||
iounmap(i2c->regs);
|
iounmap(i2c->regs);
|
||||||
|
@ -948,7 +942,7 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
|
||||||
s3c24xx_i2c_deregister_cpufreq(i2c);
|
s3c24xx_i2c_deregister_cpufreq(i2c);
|
||||||
|
|
||||||
i2c_del_adapter(&i2c->adap);
|
i2c_del_adapter(&i2c->adap);
|
||||||
free_irq(i2c->irq->start, i2c);
|
free_irq(i2c->irq, i2c);
|
||||||
|
|
||||||
clk_disable(i2c->clk);
|
clk_disable(i2c->clk);
|
||||||
clk_put(i2c->clk);
|
clk_put(i2c->clk);
|
||||||
|
|
Loading…
Reference in a new issue