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

Commit 3f3e4bd3 authored by Linus Walleij's avatar Linus Walleij Committed by Greg Kroah-Hartman
Browse files

pinctrl: amd: Use irqchip template



[ Upstream commit e81376ebbafc679a5cea65f25f5ab242172f52df ]

This makes the driver use the irqchip template to assign
properties to the gpio_irq_chip instead of using the
explicit call to gpiochip_irqchip_add().

The irqchip is instead added while adding the gpiochip.

Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Cc: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Cc: Sandeep Singh <sandeep.singh@amd.com>
Link: https://lore.kernel.org/r/20200722101545.144373-1-linus.walleij@linaro.org


Stable-dep-of: b26cd9325be4 ("pinctrl: amd: Disable and mask interrupts on resume")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 387236b9
Loading
Loading
Loading
Loading
+10 −11
Original line number Original line Diff line number Diff line
@@ -852,6 +852,7 @@ static int amd_gpio_probe(struct platform_device *pdev)
	int irq_base;
	int irq_base;
	struct resource *res;
	struct resource *res;
	struct amd_gpio *gpio_dev;
	struct amd_gpio *gpio_dev;
	struct gpio_irq_chip *girq;


	gpio_dev = devm_kzalloc(&pdev->dev,
	gpio_dev = devm_kzalloc(&pdev->dev,
				sizeof(struct amd_gpio), GFP_KERNEL);
				sizeof(struct amd_gpio), GFP_KERNEL);
@@ -913,6 +914,15 @@ static int amd_gpio_probe(struct platform_device *pdev)
		return PTR_ERR(gpio_dev->pctrl);
		return PTR_ERR(gpio_dev->pctrl);
	}
	}


	girq = &gpio_dev->gc.irq;
	girq->chip = &amd_gpio_irqchip;
	/* This will let us handle the parent IRQ in the driver */
	girq->parent_handler = NULL;
	girq->num_parents = 0;
	girq->parents = NULL;
	girq->default_type = IRQ_TYPE_NONE;
	girq->handler = handle_simple_irq;

	ret = gpiochip_add_data(&gpio_dev->gc, gpio_dev);
	ret = gpiochip_add_data(&gpio_dev->gc, gpio_dev);
	if (ret)
	if (ret)
		return ret;
		return ret;
@@ -924,17 +934,6 @@ static int amd_gpio_probe(struct platform_device *pdev)
		goto out2;
		goto out2;
	}
	}


	ret = gpiochip_irqchip_add(&gpio_dev->gc,
				&amd_gpio_irqchip,
				0,
				handle_simple_irq,
				IRQ_TYPE_NONE);
	if (ret) {
		dev_err(&pdev->dev, "could not add irqchip\n");
		ret = -ENODEV;
		goto out2;
	}

	ret = devm_request_irq(&pdev->dev, irq_base, amd_gpio_irq_handler,
	ret = devm_request_irq(&pdev->dev, irq_base, amd_gpio_irq_handler,
			       IRQF_SHARED, KBUILD_MODNAME, gpio_dev);
			       IRQF_SHARED, KBUILD_MODNAME, gpio_dev);
	if (ret)
	if (ret)