aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2014-12-04 11:20:49 -0500
committerWolfram Sang <wsa@the-dreams.de>2014-12-04 12:49:54 -0500
commit530834b13feff543a49b214eb750e97fbd7a22be (patch)
tree3a04e119e82f1b465754491d586631679a29702f /drivers/i2c
parent86261fdd65ce076c0aa05dbf3f5f5fe10aab1bcf (diff)
i2c: sh_mobile: optimize irq entry
We can simply pass the pointer to the private structure to the irq routine instead of passing the platform device and looking up its driver_data. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-sh_mobile.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index c7f36c1ce688..a758ccc29752 100644
--- a/drivers/i2c/busses/i2c-sh_mobile.c
+++ b/drivers/i2c/busses/i2c-sh_mobile.c
@@ -466,8 +466,7 @@ static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd)
466 466
467static irqreturn_t sh_mobile_i2c_isr(int irq, void *dev_id) 467static irqreturn_t sh_mobile_i2c_isr(int irq, void *dev_id)
468{ 468{
469 struct platform_device *dev = dev_id; 469 struct sh_mobile_i2c_data *pd = dev_id;
470 struct sh_mobile_i2c_data *pd = platform_get_drvdata(dev);
471 unsigned char sr; 470 unsigned char sr;
472 int wakeup = 0; 471 int wakeup = 0;
473 472
@@ -804,7 +803,7 @@ static void sh_mobile_i2c_release_dma(struct sh_mobile_i2c_data *pd)
804 } 803 }
805} 804}
806 805
807static int sh_mobile_i2c_hook_irqs(struct platform_device *dev) 806static int sh_mobile_i2c_hook_irqs(struct platform_device *dev, struct sh_mobile_i2c_data *pd)
808{ 807{
809 struct resource *res; 808 struct resource *res;
810 resource_size_t n; 809 resource_size_t n;
@@ -813,7 +812,7 @@ static int sh_mobile_i2c_hook_irqs(struct platform_device *dev)
813 while ((res = platform_get_resource(dev, IORESOURCE_IRQ, k))) { 812 while ((res = platform_get_resource(dev, IORESOURCE_IRQ, k))) {
814 for (n = res->start; n <= res->end; n++) { 813 for (n = res->start; n <= res->end; n++) {
815 ret = devm_request_irq(&dev->dev, n, sh_mobile_i2c_isr, 814 ret = devm_request_irq(&dev->dev, n, sh_mobile_i2c_isr,
816 0, dev_name(&dev->dev), dev); 815 0, dev_name(&dev->dev), pd);
817 if (ret) { 816 if (ret) {
818 dev_err(&dev->dev, "cannot request IRQ %pa\n", &n); 817 dev_err(&dev->dev, "cannot request IRQ %pa\n", &n);
819 return ret; 818 return ret;
@@ -844,7 +843,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
844 return PTR_ERR(pd->clk); 843 return PTR_ERR(pd->clk);
845 } 844 }
846 845
847 ret = sh_mobile_i2c_hook_irqs(dev); 846 ret = sh_mobile_i2c_hook_irqs(dev, pd);
848 if (ret) 847 if (ret)
849 return ret; 848 return ret;
850 849