diff options
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-s3c2410.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index f14007ff2531..2a0de645ccf3 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -61,6 +61,7 @@ struct s3c24xx_i2c { | |||
61 | unsigned int msg_ptr; | 61 | unsigned int msg_ptr; |
62 | 62 | ||
63 | unsigned int tx_setup; | 63 | unsigned int tx_setup; |
64 | unsigned int irq; | ||
64 | 65 | ||
65 | enum s3c24xx_i2c_state state; | 66 | enum s3c24xx_i2c_state state; |
66 | unsigned long clkrate; | 67 | unsigned long clkrate; |
@@ -68,7 +69,6 @@ struct s3c24xx_i2c { | |||
68 | void __iomem *regs; | 69 | void __iomem *regs; |
69 | struct clk *clk; | 70 | struct clk *clk; |
70 | struct device *dev; | 71 | struct device *dev; |
71 | struct resource *irq; | ||
72 | struct resource *ioarea; | 72 | struct resource *ioarea; |
73 | struct i2c_adapter adap; | 73 | struct i2c_adapter adap; |
74 | 74 | ||
@@ -869,26 +869,20 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) | |||
869 | * ensure no current IRQs pending | 869 | * ensure no current IRQs pending |
870 | */ | 870 | */ |
871 | 871 | ||
872 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 872 | i2c->irq = ret = platform_get_irq(pdev, 0); |
873 | if (res == NULL) { | 873 | if (ret <= 0) { |
874 | dev_err(&pdev->dev, "cannot find IRQ\n"); | 874 | dev_err(&pdev->dev, "cannot find IRQ\n"); |
875 | ret = -ENOENT; | ||
876 | goto err_iomap; | 875 | goto err_iomap; |
877 | } | 876 | } |
878 | 877 | ||
879 | ret = request_irq(res->start, s3c24xx_i2c_irq, IRQF_DISABLED, | 878 | ret = request_irq(i2c->irq, s3c24xx_i2c_irq, IRQF_DISABLED, |
880 | pdev->name, i2c); | 879 | dev_name(&pdev->dev), i2c); |
881 | 880 | ||
882 | if (ret != 0) { | 881 | if (ret != 0) { |
883 | dev_err(&pdev->dev, "cannot claim IRQ\n"); | 882 | dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq); |
884 | goto err_iomap; | 883 | goto err_iomap; |
885 | } | 884 | } |
886 | 885 | ||
887 | i2c->irq = res; | ||
888 | |||
889 | dev_dbg(&pdev->dev, "irq resource %p (%lu)\n", res, | ||
890 | (unsigned long)res->start); | ||
891 | |||
892 | ret = s3c24xx_i2c_register_cpufreq(i2c); | 886 | ret = s3c24xx_i2c_register_cpufreq(i2c); |
893 | if (ret < 0) { | 887 | if (ret < 0) { |
894 | dev_err(&pdev->dev, "failed to register cpufreq notifier\n"); | 888 | dev_err(&pdev->dev, "failed to register cpufreq notifier\n"); |
@@ -918,7 +912,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) | |||
918 | s3c24xx_i2c_deregister_cpufreq(i2c); | 912 | s3c24xx_i2c_deregister_cpufreq(i2c); |
919 | 913 | ||
920 | err_irq: | 914 | err_irq: |
921 | free_irq(i2c->irq->start, i2c); | 915 | free_irq(i2c->irq, i2c); |
922 | 916 | ||
923 | err_iomap: | 917 | err_iomap: |
924 | iounmap(i2c->regs); | 918 | iounmap(i2c->regs); |
@@ -948,7 +942,7 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev) | |||
948 | s3c24xx_i2c_deregister_cpufreq(i2c); | 942 | s3c24xx_i2c_deregister_cpufreq(i2c); |
949 | 943 | ||
950 | i2c_del_adapter(&i2c->adap); | 944 | i2c_del_adapter(&i2c->adap); |
951 | free_irq(i2c->irq->start, i2c); | 945 | free_irq(i2c->irq, i2c); |
952 | 946 | ||
953 | clk_disable(i2c->clk); | 947 | clk_disable(i2c->clk); |
954 | clk_put(i2c->clk); | 948 | clk_put(i2c->clk); |