Skip to content

Commit e0d1ec9

Browse files
author
Ben Dooks
committed
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>
1 parent 692acbd commit e0d1ec9

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

‎drivers/i2c/busses/i2c-s3c2410.c‎

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ struct s3c24xx_i2c {
6161
unsigned int msg_ptr;
6262

6363
unsigned int tx_setup;
64+
unsigned int irq;
6465

6566
enum s3c24xx_i2c_state state;
6667
unsigned long clkrate;
6768

6869
void __iomem *regs;
6970
struct clk *clk;
7071
struct device *dev;
71-
struct resource *irq;
7272
struct resource *ioarea;
7373
struct i2c_adapter adap;
7474

@@ -869,26 +869,20 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
869869
* ensure no current IRQs pending
870870
*/
871871

872-
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
873-
if (res == NULL) {
872+
i2c->irq = ret = platform_get_irq(pdev, 0);
873+
if (ret <= 0) {
874874
dev_err(&pdev->dev, "cannot find IRQ\n");
875-
ret = -ENOENT;
876875
goto err_iomap;
877876
}
878877

879-
ret = request_irq(res->start, s3c24xx_i2c_irq, IRQF_DISABLED,
880-
pdev->name, i2c);
878+
ret = request_irq(i2c->irq, s3c24xx_i2c_irq, IRQF_DISABLED,
879+
dev_name(&pdev->dev), i2c);
881880

882881
if (ret != 0) {
883-
dev_err(&pdev->dev, "cannot claim IRQ\n");
882+
dev_err(&pdev->dev, "cannot claim IRQ %d\n", i2c->irq);
884883
goto err_iomap;
885884
}
886885

887-
i2c->irq = res;
888-
889-
dev_dbg(&pdev->dev, "irq resource %p (%lu)\n", res,
890-
(unsigned long)res->start);
891-
892886
ret = s3c24xx_i2c_register_cpufreq(i2c);
893887
if (ret < 0) {
894888
dev_err(&pdev->dev, "failed to register cpufreq notifier\n");
@@ -918,7 +912,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
918912
s3c24xx_i2c_deregister_cpufreq(i2c);
919913

920914
err_irq:
921-
free_irq(i2c->irq->start, i2c);
915+
free_irq(i2c->irq, i2c);
922916

923917
err_iomap:
924918
iounmap(i2c->regs);
@@ -948,7 +942,7 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev)
948942
s3c24xx_i2c_deregister_cpufreq(i2c);
949943

950944
i2c_del_adapter(&i2c->adap);
951-
free_irq(i2c->irq->start, i2c);
945+
free_irq(i2c->irq, i2c);
952946

953947
clk_disable(i2c->clk);
954948
clk_put(i2c->clk);

0 commit comments

Comments
 (0)