Commit 7bb7780e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'gpio-fixes-for-v6.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio fix from Bartosz Golaszewski:

 - fix the way optional interrupts are retrieved from firmware in
   gpio-mlxbf3

* tag 'gpio-fixes-for-v6.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
  gpio: mlxbf3: use platform_get_irq_optional()
  Revert "gpio: mlxbf3: only get IRQ for device instance 0"
parents 66ba63d4 810bd906
Loading
Loading
Loading
Loading
+19 −35
Original line number Diff line number Diff line
@@ -190,9 +190,7 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
	struct mlxbf3_gpio_context *gs;
	struct gpio_irq_chip *girq;
	struct gpio_chip *gc;
	char *colon_ptr;
	int ret, irq;
	long num;

	gs = devm_kzalloc(dev, sizeof(*gs), GFP_KERNEL);
	if (!gs)
@@ -229,20 +227,7 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
	gc->owner = THIS_MODULE;
	gc->add_pin_ranges = mlxbf3_gpio_add_pin_ranges;

	colon_ptr = strchr(dev_name(dev), ':');
	if (!colon_ptr) {
		dev_err(dev, "invalid device name format\n");
		return -EINVAL;
	}

	ret = kstrtol(++colon_ptr, 16, &num);
	if (ret) {
		dev_err(dev, "invalid device instance\n");
		return ret;
	}

	if (!num) {
		irq = platform_get_irq(pdev, 0);
	irq = platform_get_irq_optional(pdev, 0);
	if (irq >= 0) {
		girq = &gs->gc.irq;
		gpio_irq_chip_set_chip(girq, &gpio_mlxbf3_irqchip);
@@ -262,7 +247,6 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
		if (ret)
			return dev_err_probe(dev, ret, "failed to request IRQ");
	}
	}

	platform_set_drvdata(pdev, gs);