Fixes for v4.18:
- 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. -----BEGIN PGP SIGNATURE----- iQIcBAABAgAGBQJbK90HAAoJEEEQszewGV1zcYIP/1ic2QiXFlOdXgYi4ok/oPD5 oG64tE4S1lC4OX4l2lXyvSS46POn+73WynzPrpPkmGm4Q8KC0uqUZPtMq3xLRxnH pqz+h3eVogcLRskZNFfi/T2puT5Gsr8hO1HoV8hEeDChI2+m98aOgtx5z4ZTvlkf uJ9firRaQP5Kvw9w2imCWiodGGC9N6ebUXbrRFt0iGeurZMD9SeZ5cnN/UzLNkUY lbqRK03uVZZxtSudKhO7kEGV08u6kyqeoEMWy2PSUQiXUhKOZ8gHwLeIGB5EbYEl zyN5Dklgi54rpBPOu51B3K8lOAYhN66TH6+HTc9eQNbxRVudqboJETm5ENhXLhcN MTebNKP7nQL5EPGqpx3LEJE9j3sYBCDQzwS8uktXHLcYvAELtFPogUru8ACMenLU b0qH7gSEnASkhnicbpBSybPvcMg2i2Y2RirxKPXiiTnBlhtxjM38IpPw4JG47tHn vISE+FWx2cPJxcv9qIY7Gf0Gxi8UyXHHUz2+aq2rV0AVtstvXxClk5+o9wMCvNEg y7OyZlKks5yncn/oHQTXe9qy9RzdmcyFgwnrGounvb8NVtVmJvIDJu4UGVfmddda USmkCYzwsZseuIcc9g2am06NE2SqqYWvzD66lDbH/t875aLxRymngUOPO0uhYKn1 NjQEGZPxJQHutblcoQ4v =Kpuk -----END PGP SIGNATURE----- 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()
This commit is contained in:
commit
acdf3f93b6
5 changed files with 22 additions and 12 deletions
|
@ -333,7 +333,7 @@ static int owl_pin_config_set(struct pinctrl_dev *pctrldev,
|
|||
unsigned long flags;
|
||||
unsigned int param;
|
||||
u32 reg, bit, width, arg;
|
||||
int ret, i;
|
||||
int ret = 0, i;
|
||||
|
||||
info = &pctrl->soc->padinfo[pin];
|
||||
|
||||
|
|
|
@ -101,10 +101,11 @@ struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
|
|||
}
|
||||
|
||||
static int dt_to_map_one_config(struct pinctrl *p,
|
||||
struct pinctrl_dev *pctldev,
|
||||
struct pinctrl_dev *hog_pctldev,
|
||||
const char *statename,
|
||||
struct device_node *np_config)
|
||||
{
|
||||
struct pinctrl_dev *pctldev = NULL;
|
||||
struct device_node *np_pctldev;
|
||||
const struct pinctrl_ops *ops;
|
||||
int ret;
|
||||
|
@ -123,8 +124,10 @@ static int dt_to_map_one_config(struct pinctrl *p,
|
|||
return -EPROBE_DEFER;
|
||||
}
|
||||
/* If we're creating a hog we can use the passed pctldev */
|
||||
if (pctldev && (np_pctldev == p->dev->of_node))
|
||||
if (hog_pctldev && (np_pctldev == p->dev->of_node)) {
|
||||
pctldev = hog_pctldev;
|
||||
break;
|
||||
}
|
||||
pctldev = get_pinctrl_dev_from_of_node(np_pctldev);
|
||||
if (pctldev)
|
||||
break;
|
||||
|
|
|
@ -1459,6 +1459,9 @@ static int mtk_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
|
|||
struct mtk_pinctrl *hw = gpiochip_get_data(chip);
|
||||
unsigned long eint_n;
|
||||
|
||||
if (!hw->eint)
|
||||
return -ENOTSUPP;
|
||||
|
||||
eint_n = offset;
|
||||
|
||||
return mtk_eint_find_irq(hw->eint, eint_n);
|
||||
|
@ -1471,7 +1474,8 @@ static int mtk_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
|
|||
unsigned long eint_n;
|
||||
u32 debounce;
|
||||
|
||||
if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
|
||||
if (!hw->eint ||
|
||||
pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
|
||||
return -ENOTSUPP;
|
||||
|
||||
debounce = pinconf_to_config_argument(config);
|
||||
|
|
|
@ -1000,11 +1000,6 @@ static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev)
|
|||
return -ENOMEM;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!res) {
|
||||
dev_err(&pdev->dev, "Unable to get eint resource\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
pctl->eint->base = devm_ioremap_resource(&pdev->dev, res);
|
||||
if (IS_ERR(pctl->eint->base))
|
||||
return PTR_ERR(pctl->eint->base);
|
||||
|
|
|
@ -1590,8 +1590,11 @@ static int pcs_save_context(struct pcs_device *pcs)
|
|||
|
||||
mux_bytes = pcs->width / BITS_PER_BYTE;
|
||||
|
||||
if (!pcs->saved_vals)
|
||||
if (!pcs->saved_vals) {
|
||||
pcs->saved_vals = devm_kzalloc(pcs->dev, pcs->size, GFP_ATOMIC);
|
||||
if (!pcs->saved_vals)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
switch (pcs->width) {
|
||||
case 64:
|
||||
|
@ -1651,8 +1654,13 @@ static int pinctrl_single_suspend(struct platform_device *pdev,
|
|||
if (!pcs)
|
||||
return -EINVAL;
|
||||
|
||||
if (pcs->flags & PCS_CONTEXT_LOSS_OFF)
|
||||
pcs_save_context(pcs);
|
||||
if (pcs->flags & PCS_CONTEXT_LOSS_OFF) {
|
||||
int ret;
|
||||
|
||||
ret = pcs_save_context(pcs);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
return pinctrl_force_sleep(pcs->pctl);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue