Commit 90d17632 authored by Joel Stanley's avatar Joel Stanley Committed by Bartosz Golaszewski
Browse files

gpio: aspeed: Always register the irqchip



The driver was implemented in a way that made the irqchip optional, if a
irq was not present in the device tree. However, all of the device trees
have always had an irq, so the optional-ness has never been used.

Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent d4c0cf34
Loading
Loading
Loading
Loading
+23 −26
Original line number Diff line number Diff line
@@ -1137,8 +1137,9 @@ MODULE_DEVICE_TABLE(of, aspeed_gpio_of_table);
static int __init aspeed_gpio_probe(struct platform_device *pdev)
{
	const struct of_device_id *gpio_id;
	struct gpio_irq_chip *girq;
	struct aspeed_gpio *gpio;
	int rc, i, banks, err;
	int rc, irq, i, banks, err;
	u32 ngpio;

	gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
@@ -1201,12 +1202,11 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
		aspeed_gpio_change_cmd_source(gpio, bank, 3, GPIO_CMDSRC_ARM);
	}

	/* Optionally set up an irqchip if there is an IRQ */
	rc = platform_get_irq(pdev, 0);
	if (rc > 0) {
		struct gpio_irq_chip *girq;

		gpio->irq = rc;
	/* Set up an irqchip */
	irq = platform_get_irq(pdev, 0);
	if (irq < 0)
		return irq;
	gpio->irq = irq;
	girq = &gpio->chip.irq;
	girq->chip = &gpio->irqc;
	girq->chip->name = dev_name(&pdev->dev);
@@ -1216,16 +1216,13 @@ static int __init aspeed_gpio_probe(struct platform_device *pdev)
	girq->chip->irq_set_type = aspeed_gpio_set_type;
	girq->parent_handler = aspeed_gpio_irq_handler;
	girq->num_parents = 1;
		girq->parents = devm_kcalloc(&pdev->dev, 1,
					     sizeof(*girq->parents),
					     GFP_KERNEL);
	girq->parents = devm_kcalloc(&pdev->dev, 1, sizeof(*girq->parents), GFP_KERNEL);
	if (!girq->parents)
		return -ENOMEM;
	girq->parents[0] = gpio->irq;
	girq->default_type = IRQ_TYPE_NONE;
	girq->handler = handle_bad_irq;
	girq->init_valid_mask = aspeed_init_irq_valid_mask;
	}

	gpio->offset_timer =
		devm_kzalloc(&pdev->dev, gpio->chip.ngpio, GFP_KERNEL);