diff options
| -rw-r--r-- | drivers/pinctrl/pinctrl-max77620.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/pinctrl/pinctrl-max77620.c b/drivers/pinctrl/pinctrl-max77620.c index b8d2180a2bea..a7f37063518e 100644 --- a/drivers/pinctrl/pinctrl-max77620.c +++ b/drivers/pinctrl/pinctrl-max77620.c | |||
| @@ -420,11 +420,9 @@ static int max77620_pinconf_set(struct pinctrl_dev *pctldev, | |||
| 420 | MAX77620_REG_GPIO0 + pin, | 420 | MAX77620_REG_GPIO0 + pin, |
| 421 | MAX77620_CNFG_GPIO_DRV_MASK, | 421 | MAX77620_CNFG_GPIO_DRV_MASK, |
| 422 | val); | 422 | val); |
| 423 | if (ret < 0) { | 423 | if (ret) |
| 424 | dev_err(dev, "Reg 0x%02x update failed %d\n", | 424 | goto report_update_failure; |
| 425 | MAX77620_REG_GPIO0 + pin, ret); | 425 | |
| 426 | return ret; | ||
| 427 | } | ||
| 428 | mpci->pin_info[pin].drv_type = val ? | 426 | mpci->pin_info[pin].drv_type = val ? |
| 429 | MAX77620_PIN_PP_DRV : MAX77620_PIN_OD_DRV; | 427 | MAX77620_PIN_PP_DRV : MAX77620_PIN_OD_DRV; |
| 430 | break; | 428 | break; |
| @@ -435,11 +433,9 @@ static int max77620_pinconf_set(struct pinctrl_dev *pctldev, | |||
| 435 | MAX77620_REG_GPIO0 + pin, | 433 | MAX77620_REG_GPIO0 + pin, |
| 436 | MAX77620_CNFG_GPIO_DRV_MASK, | 434 | MAX77620_CNFG_GPIO_DRV_MASK, |
| 437 | val); | 435 | val); |
| 438 | if (ret < 0) { | 436 | if (ret) |
| 439 | dev_err(dev, "Reg 0x%02x update failed %d\n", | 437 | goto report_update_failure; |
| 440 | MAX77620_REG_GPIO0 + pin, ret); | 438 | |
| 441 | return ret; | ||
| 442 | } | ||
| 443 | mpci->pin_info[pin].drv_type = val ? | 439 | mpci->pin_info[pin].drv_type = val ? |
| 444 | MAX77620_PIN_PP_DRV : MAX77620_PIN_OD_DRV; | 440 | MAX77620_PIN_PP_DRV : MAX77620_PIN_OD_DRV; |
| 445 | break; | 441 | break; |
| @@ -536,6 +532,11 @@ static int max77620_pinconf_set(struct pinctrl_dev *pctldev, | |||
| 536 | } | 532 | } |
| 537 | 533 | ||
| 538 | return 0; | 534 | return 0; |
| 535 | |||
| 536 | report_update_failure: | ||
| 537 | dev_err(dev, "Reg 0x%02x update failed %d\n", | ||
| 538 | MAX77620_REG_GPIO0 + pin, ret); | ||
| 539 | return ret; | ||
| 539 | } | 540 | } |
| 540 | 541 | ||
| 541 | static const struct pinconf_ops max77620_pinconf_ops = { | 542 | static const struct pinconf_ops max77620_pinconf_ops = { |
