Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pinctrl-v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pin control fixes from Linus Walleij:
"Some fallout in the pin control subsystem in the first week after the
merge window, some minor fixes so I'd like to get it to you ASAP.

- fix a serious kernel panic on the Mediatek driver with the external
interrupt controller.

- fix an uninitialized compiler warning in the owl (actions) driver.

- allocation failure in the pinctrl-single driver.

- pointer overwrite problem in the i.MX driver.

- fix a small compiler warning"

* tag 'pinctrl-v4.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
pinctrl: mt7622: fix a kernel panic when pio don't work as EINT controller
pinctrl: actions: Fix uninitialized error in owl_pin_config_set()
pinctrl: single: Add allocation failure checking of saved_vals
pinctrl: devicetree: Fix pctldev pointer overwrite
pinctrl: mediatek: remove redundant return value check of platform_get_resource()

+22 -12
+1 -1
drivers/pinctrl/actions/pinctrl-owl.c
··· 333 333 unsigned long flags; 334 334 unsigned int param; 335 335 u32 reg, bit, width, arg; 336 - int ret, i; 336 + int ret = 0, i; 337 337 338 338 info = &pctrl->soc->padinfo[pin]; 339 339
+5 -2
drivers/pinctrl/devicetree.c
··· 101 101 } 102 102 103 103 static int dt_to_map_one_config(struct pinctrl *p, 104 - struct pinctrl_dev *pctldev, 104 + struct pinctrl_dev *hog_pctldev, 105 105 const char *statename, 106 106 struct device_node *np_config) 107 107 { 108 + struct pinctrl_dev *pctldev = NULL; 108 109 struct device_node *np_pctldev; 109 110 const struct pinctrl_ops *ops; 110 111 int ret; ··· 124 123 return -EPROBE_DEFER; 125 124 } 126 125 /* If we're creating a hog we can use the passed pctldev */ 127 - if (pctldev && (np_pctldev == p->dev->of_node)) 126 + if (hog_pctldev && (np_pctldev == p->dev->of_node)) { 127 + pctldev = hog_pctldev; 128 128 break; 129 + } 129 130 pctldev = get_pinctrl_dev_from_of_node(np_pctldev); 130 131 if (pctldev) 131 132 break;
+5 -1
drivers/pinctrl/mediatek/pinctrl-mt7622.c
··· 1459 1459 struct mtk_pinctrl *hw = gpiochip_get_data(chip); 1460 1460 unsigned long eint_n; 1461 1461 1462 + if (!hw->eint) 1463 + return -ENOTSUPP; 1464 + 1462 1465 eint_n = offset; 1463 1466 1464 1467 return mtk_eint_find_irq(hw->eint, eint_n); ··· 1474 1471 unsigned long eint_n; 1475 1472 u32 debounce; 1476 1473 1477 - if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE) 1474 + if (!hw->eint || 1475 + pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE) 1478 1476 return -ENOTSUPP; 1479 1477 1480 1478 debounce = pinconf_to_config_argument(config);
-5
drivers/pinctrl/mediatek/pinctrl-mtk-common.c
··· 1000 1000 return -ENOMEM; 1001 1001 1002 1002 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1003 - if (!res) { 1004 - dev_err(&pdev->dev, "Unable to get eint resource\n"); 1005 - return -ENODEV; 1006 - } 1007 - 1008 1003 pctl->eint->base = devm_ioremap_resource(&pdev->dev, res); 1009 1004 if (IS_ERR(pctl->eint->base)) 1010 1005 return PTR_ERR(pctl->eint->base);
+11 -3
drivers/pinctrl/pinctrl-single.c
··· 1590 1590 1591 1591 mux_bytes = pcs->width / BITS_PER_BYTE; 1592 1592 1593 - if (!pcs->saved_vals) 1593 + if (!pcs->saved_vals) { 1594 1594 pcs->saved_vals = devm_kzalloc(pcs->dev, pcs->size, GFP_ATOMIC); 1595 + if (!pcs->saved_vals) 1596 + return -ENOMEM; 1597 + } 1595 1598 1596 1599 switch (pcs->width) { 1597 1600 case 64: ··· 1654 1651 if (!pcs) 1655 1652 return -EINVAL; 1656 1653 1657 - if (pcs->flags & PCS_CONTEXT_LOSS_OFF) 1658 - pcs_save_context(pcs); 1654 + if (pcs->flags & PCS_CONTEXT_LOSS_OFF) { 1655 + int ret; 1656 + 1657 + ret = pcs_save_context(pcs); 1658 + if (ret < 0) 1659 + return ret; 1660 + } 1659 1661 1660 1662 return pinctrl_force_sleep(pcs->pctl); 1661 1663 }