Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wolfram Sang and committed by
Wolfram Sang
530834b1 86261fdd

+4 -5
+4 -5
drivers/i2c/busses/i2c-sh_mobile.c
··· 466 466 467 467 static irqreturn_t sh_mobile_i2c_isr(int irq, void *dev_id) 468 468 { 469 - struct platform_device *dev = dev_id; 470 - struct sh_mobile_i2c_data *pd = platform_get_drvdata(dev); 469 + struct sh_mobile_i2c_data *pd = dev_id; 471 470 unsigned char sr; 472 471 int wakeup = 0; 473 472 ··· 803 804 } 804 805 } 805 806 806 - static int sh_mobile_i2c_hook_irqs(struct platform_device *dev) 807 + static int sh_mobile_i2c_hook_irqs(struct platform_device *dev, struct sh_mobile_i2c_data *pd) 807 808 { 808 809 struct resource *res; 809 810 resource_size_t n; ··· 812 813 while ((res = platform_get_resource(dev, IORESOURCE_IRQ, k))) { 813 814 for (n = res->start; n <= res->end; n++) { 814 815 ret = devm_request_irq(&dev->dev, n, sh_mobile_i2c_isr, 815 - 0, dev_name(&dev->dev), dev); 816 + 0, dev_name(&dev->dev), pd); 816 817 if (ret) { 817 818 dev_err(&dev->dev, "cannot request IRQ %pa\n", &n); 818 819 return ret; ··· 843 844 return PTR_ERR(pd->clk); 844 845 } 845 846 846 - ret = sh_mobile_i2c_hook_irqs(dev); 847 + ret = sh_mobile_i2c_hook_irqs(dev, pd); 847 848 if (ret) 848 849 return ret; 849 850