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

Commit 9bca4df2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull GPIO fixes from Linus Walleij:
 "This is a first set of GPIO fixes for the v4.2 series, all hitting
  individual drivers and nothing else (except for a documentation
  oneliner.  I intended to send a request earlier but life intervened)"

* tag 'gpio-v4.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: pca953x: fix nested irqs rescheduling
  gpio: omap: prevent module from being unloaded while in use
  gpio: max732x: Add missing dev reference to gpiochip
  gpio/xilinx: Use correct address when setting initial values.
  gpio: zynq: Fix problem with unbalanced pm_runtime_enable
  gpio: omap: add missed spin_unlock_irqrestore in omap_gpio_irq_type
  gpio: brcmstb: fix null ptr dereference in driver remove
  gpio: Remove double "base" in comment
parents e05bf4f3 fdd50409
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -87,6 +87,15 @@ static int brcmstb_gpio_remove(struct platform_device *pdev)
	struct brcmstb_gpio_bank *bank;
	int ret = 0;

	if (!priv) {
		dev_err(&pdev->dev, "called %s without drvdata!\n", __func__);
		return -EFAULT;
	}

	/*
	 * You can lose return values below, but we report all errors, and it's
	 * more important to actually perform all of the steps.
	 */
	list_for_each(pos, &priv->bank_list) {
		bank = list_entry(pos, struct brcmstb_gpio_bank, node);
		ret = bgpio_remove(&bank->bgc);
@@ -143,6 +152,8 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
	if (!priv)
		return -ENOMEM;
	platform_set_drvdata(pdev, priv);
	INIT_LIST_HEAD(&priv->bank_list);

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	reg_base = devm_ioremap_resource(dev, res);
@@ -153,7 +164,6 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
	priv->reg_base = reg_base;
	priv->pdev = pdev;

	INIT_LIST_HEAD(&priv->bank_list);
	if (brcmstb_gpio_sanity_check_banks(dev, np, res))
		return -EINVAL;

@@ -221,8 +231,6 @@ static int brcmstb_gpio_probe(struct platform_device *pdev)
	dev_info(dev, "Registered %d banks (GPIO(s): %d-%d)\n",
			priv->num_banks, priv->gpio_base, gpio_base - 1);

	platform_set_drvdata(pdev, priv);

	return 0;

fail:
+1 −0
Original line number Diff line number Diff line
@@ -603,6 +603,7 @@ static int max732x_setup_gpio(struct max732x_chip *chip,
	gc->base = gpio_start;
	gc->ngpio = port;
	gc->label = chip->client->name;
	gc->dev = &chip->client->dev;
	gc->owner = THIS_MODULE;

	return port;
+4 −1
Original line number Diff line number Diff line
@@ -500,8 +500,10 @@ static int omap_gpio_irq_type(struct irq_data *d, unsigned type)

	spin_lock_irqsave(&bank->lock, flags);
	retval = omap_set_gpio_triggering(bank, offset, type);
	if (retval)
	if (retval) {
		spin_unlock_irqrestore(&bank->lock, flags);
		goto error;
	}
	omap_gpio_init_irq(bank, offset);
	if (!omap_gpio_is_input(bank, offset)) {
		spin_unlock_irqrestore(&bank->lock, flags);
@@ -1185,6 +1187,7 @@ static int omap_gpio_probe(struct platform_device *pdev)
	bank->irq = res->start;
	bank->dev = dev;
	bank->chip.dev = dev;
	bank->chip.owner = THIS_MODULE;
	bank->dbck_flag = pdata->dbck_flag;
	bank->stride = pdata->bank_stride;
	bank->width = pdata->bank_width;
+4 −0
Original line number Diff line number Diff line
@@ -570,6 +570,10 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
				"could not connect irqchip to gpiochip\n");
			return ret;
		}

		gpiochip_set_chained_irqchip(&chip->gpio_chip,
					     &pca953x_irq_chip,
					     client->irq, NULL);
	}

	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -220,9 +220,9 @@ static void xgpio_save_regs(struct of_mm_gpio_chip *mm_gc)
	if (!chip->gpio_width[1])
		return;

	xgpio_writereg(mm_gc->regs + XGPIO_DATA_OFFSET + XGPIO_TRI_OFFSET,
	xgpio_writereg(mm_gc->regs + XGPIO_DATA_OFFSET + XGPIO_CHANNEL_OFFSET,
		       chip->gpio_state[1]);
	xgpio_writereg(mm_gc->regs + XGPIO_TRI_OFFSET + XGPIO_TRI_OFFSET,
	xgpio_writereg(mm_gc->regs + XGPIO_TRI_OFFSET + XGPIO_CHANNEL_OFFSET,
		       chip->gpio_dir[1]);
}

Loading