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

gpio: pca953x: Get rid of useless goto label

In a few functions goto label is useless as there are no locking,
no nothing that may justify its usage. Get rid of it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Andy Shevchenko and committed by
Bartosz Golaszewski
40db0755 7c301306

+7 -17
+7 -17
drivers/gpio/gpio-pca953x.c
··· 988 988 ret = regcache_sync_region(chip->regmap, regaddr, 989 989 regaddr + NBANK(chip) - 1); 990 990 if (ret) 991 - goto out; 991 + return ret; 992 992 993 993 regaddr = chip->recalc_addr(chip, chip->regs->direction, 0); 994 994 ret = regcache_sync_region(chip->regmap, regaddr, 995 995 regaddr + NBANK(chip) - 1); 996 996 if (ret) 997 - goto out; 997 + return ret; 998 998 999 999 /* clear polarity inversion */ 1000 1000 bitmap_zero(val, MAX_LINE); 1001 1001 1002 - ret = pca953x_write_regs(chip, chip->regs->invert, val); 1003 - out: 1004 - return ret; 1002 + return pca953x_write_regs(chip, chip->regs->invert, val); 1005 1003 } 1006 1004 1007 1005 static int device_pca957x_init(struct pca953x_chip *chip) ··· 1010 1012 1011 1013 ret = device_pca95xx_init(chip); 1012 1014 if (ret) 1013 - goto out; 1015 + return ret; 1014 1016 1015 1017 /* To enable register 6, 7 to control pull up and pull down */ 1016 1018 for (i = 0; i < NBANK(chip); i++) 1017 1019 bitmap_set_value8(val, 0x02, i * BANK_SZ); 1018 1020 1019 - ret = pca953x_write_regs(chip, PCA957X_BKEN, val); 1020 - if (ret) 1021 - goto out; 1022 - 1023 - return 0; 1024 - out: 1025 - return ret; 1021 + return pca953x_write_regs(chip, PCA957X_BKEN, val); 1026 1022 } 1027 1023 1028 1024 static void pca953x_disable_regulator(void *reg) ··· 1254 1262 } 1255 1263 1256 1264 ret = pca953x_restore_context(chip); 1257 - if (ret) { 1265 + if (ret) 1258 1266 dev_err(dev, "Failed to restore register map: %d\n", ret); 1259 - return ret; 1260 - } 1261 1267 1262 - return 0; 1268 + return ret; 1263 1269 } 1264 1270 1265 1271 static DEFINE_SIMPLE_DEV_PM_OPS(pca953x_pm_ops, pca953x_suspend, pca953x_resume);