Pull GPIO fixes from Linus Walleij: "Not much to say about them, regular fixes: - Fix a bug on the errorpath of gpiochip_add_data_with_key() - IRQ type setting on the spreadtrum GPIO driver" * tag 'gpio-v5.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: Fix gpiochip_add_data_with_key() error path gpio: eic: sprd: Fix incorrect irq type setting for the sync EIC
Unified · Split
| @@ -414,6 +414,7 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) · 413 unmodified lines | ||
| 414 | 414 | irq_set_handler_locked(data, handle_edge_irq); |
| 415 | 415 | break; |
| 416 | 416 | case IRQ_TYPE_EDGE_BOTH: |
| 417 | + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0); | |
| 417 | 418 | sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 1); |
| 418 | 419 | irq_set_handler_locked(data, handle_edge_irq); |
| 419 | 420 | break; |
| @@ -1379,7 +1379,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, · 1378 unmodified lines | ||
| 1379 | 1379 | |
| 1380 | 1380 | status = gpiochip_add_irqchip(chip, lock_key, request_key); |
| 1381 | 1381 | if (status) |
| 1382 | − goto err_remove_chip; | |
| 1382 | + goto err_free_gpiochip_mask; | |
| 1383 | 1383 | |
| 1384 | 1384 | status = of_gpiochip_add(chip); |
| 1385 | 1385 | if (status) |
| @@ -1387,7 +1387,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, · 1 unmodified line | ||
| 1387 | 1387 | |
| 1388 | 1388 | status = gpiochip_init_valid_mask(chip); |
| 1389 | 1389 | if (status) |
| 1390 | − goto err_remove_chip; | |
| 1390 | + goto err_remove_of_chip; | |
| 1391 | 1391 | |
| 1392 | 1392 | for (i = 0; i < chip->ngpio; i++) { |
| 1393 | 1393 | struct gpio_desc *desc = &gdev->descs[i]; |
| @@ -1415,14 +1415,18 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, · 21 unmodified lines | ||
| 1415 | 1415 | if (gpiolib_initialized) { |
| 1416 | 1416 | status = gpiochip_setup_dev(gdev); |
| 1417 | 1417 | if (status) |
| 1418 | − goto err_remove_chip; | |
| 1418 | + goto err_remove_acpi_chip; | |
| 1419 | 1419 | } |
| 1420 | 1420 | return 0; |
| 1421 | 1421 | |
| 1422 | −err_remove_chip: | |
| 1422 | +err_remove_acpi_chip: | |
| 1423 | 1423 | acpi_gpiochip_remove(chip); |
| 1424 | +err_remove_of_chip: | |
| 1424 | 1425 | gpiochip_free_hogs(chip); |
| 1425 | 1426 | of_gpiochip_remove(chip); |
| 1427 | +err_remove_chip: | |
| 1428 | + gpiochip_irqchip_remove(chip); | |
| 1429 | +err_free_gpiochip_mask: | |
| 1426 | 1430 | gpiochip_free_valid_mask(chip); |
| 1427 | 1431 | err_remove_irqchip_mask: |
| 1428 | 1432 | gpiochip_irqchip_free_valid_mask(chip); |