Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 530834b1 authored by Wolfram Sang's avatar Wolfram Sang Committed by Wolfram Sang
Browse files

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 86261fdd
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -466,8 +466,7 @@ static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd)


static irqreturn_t sh_mobile_i2c_isr(int irq, void *dev_id)
static irqreturn_t sh_mobile_i2c_isr(int irq, void *dev_id)
{
{
	struct platform_device *dev = dev_id;
	struct sh_mobile_i2c_data *pd = dev_id;
	struct sh_mobile_i2c_data *pd = platform_get_drvdata(dev);
	unsigned char sr;
	unsigned char sr;
	int wakeup = 0;
	int wakeup = 0;


@@ -804,7 +803,7 @@ static void sh_mobile_i2c_release_dma(struct sh_mobile_i2c_data *pd)
	}
	}
}
}


static int sh_mobile_i2c_hook_irqs(struct platform_device *dev)
static int sh_mobile_i2c_hook_irqs(struct platform_device *dev, struct sh_mobile_i2c_data *pd)
{
{
	struct resource *res;
	struct resource *res;
	resource_size_t n;
	resource_size_t n;
@@ -813,7 +812,7 @@ static int sh_mobile_i2c_hook_irqs(struct platform_device *dev)
	while ((res = platform_get_resource(dev, IORESOURCE_IRQ, k))) {
	while ((res = platform_get_resource(dev, IORESOURCE_IRQ, k))) {
		for (n = res->start; n <= res->end; n++) {
		for (n = res->start; n <= res->end; n++) {
			ret = devm_request_irq(&dev->dev, n, sh_mobile_i2c_isr,
			ret = devm_request_irq(&dev->dev, n, sh_mobile_i2c_isr,
					  0, dev_name(&dev->dev), dev);
					  0, dev_name(&dev->dev), pd);
			if (ret) {
			if (ret) {
				dev_err(&dev->dev, "cannot request IRQ %pa\n", &n);
				dev_err(&dev->dev, "cannot request IRQ %pa\n", &n);
				return ret;
				return ret;
@@ -844,7 +843,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
		return PTR_ERR(pd->clk);
		return PTR_ERR(pd->clk);
	}
	}


	ret = sh_mobile_i2c_hook_irqs(dev);
	ret = sh_mobile_i2c_hook_irqs(dev, pd);
	if (ret)
	if (ret)
		return ret;
		return ret;