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

pinctrl: cy8c95x0: remove unneeded goto labels

In some cases the code uses goto labels to just return an error code.
Replace those with direct return:s and drop unneeded goto labels.

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/20241110210040.18918-7-andy.shevchenko@gmail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Andy Shevchenko and committed by
Linus Walleij
581d2405 ab899a0e

+8 -18
+8 -18
drivers/pinctrl/pinctrl-cy8c95x0.c
··· 746 746 747 747 ret = cy8c95x0_regmap_read(chip, CY8C95X0_DIRECTION, port, &reg_val); 748 748 if (ret < 0) 749 - goto out; 749 + return ret; 750 750 751 751 if (reg_val & bit) 752 752 return GPIO_LINE_DIRECTION_IN; 753 753 754 754 return GPIO_LINE_DIRECTION_OUT; 755 - out: 756 - return ret; 757 755 } 758 756 759 757 static int cy8c95x0_gpio_get_pincfg(struct cy8c95x0_pinctrl *chip, ··· 813 815 case PIN_CONFIG_SLEEP_HARDWARE_STATE: 814 816 case PIN_CONFIG_SLEW_RATE: 815 817 default: 816 - ret = -ENOTSUPP; 817 - goto out; 818 + return -ENOTSUPP; 818 819 } 819 820 /* 820 821 * Writing 1 to one of the drive mode registers will automatically ··· 821 824 */ 822 825 ret = cy8c95x0_regmap_read(chip, reg, port, &reg_val); 823 826 if (ret < 0) 824 - goto out; 827 + return ret; 825 828 826 829 if (reg_val & bit) 827 830 arg = 1; ··· 829 832 arg = !arg; 830 833 831 834 *config = pinconf_to_config_packed(param, (u16)arg); 832 - out: 833 - return ret; 835 + return 0; 834 836 } 835 837 836 838 static int cy8c95x0_gpio_set_pincfg(struct cy8c95x0_pinctrl *chip, ··· 841 845 unsigned long param = pinconf_to_config_param(config); 842 846 unsigned long arg = pinconf_to_config_argument(config); 843 847 unsigned int reg; 844 - int ret; 845 848 846 849 switch (param) { 847 850 case PIN_CONFIG_BIAS_PULL_UP: ··· 871 876 reg = CY8C95X0_PWMSEL; 872 877 break; 873 878 case PIN_CONFIG_OUTPUT_ENABLE: 874 - ret = cy8c95x0_pinmux_direction(chip, off, !arg); 875 - goto out; 879 + return cy8c95x0_pinmux_direction(chip, off, !arg); 876 880 case PIN_CONFIG_INPUT_ENABLE: 877 - ret = cy8c95x0_pinmux_direction(chip, off, arg); 878 - goto out; 881 + return cy8c95x0_pinmux_direction(chip, off, arg); 879 882 default: 880 - ret = -ENOTSUPP; 881 - goto out; 883 + return -ENOTSUPP; 882 884 } 883 885 /* 884 886 * Writing 1 to one of the drive mode registers will automatically 885 887 * clear conflicting set bits in the other drive mode registers. 886 888 */ 887 - ret = cy8c95x0_regmap_write_bits(chip, reg, port, bit, bit); 888 - out: 889 - return ret; 889 + return cy8c95x0_regmap_write_bits(chip, reg, port, bit, bit); 890 890 } 891 891 892 892 static int cy8c95x0_gpio_get_multiple(struct gpio_chip *gc,