aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndi Shyti <andi.shyti@samsung.com>2016-07-12 06:02:12 -0400
committerMark Brown <broonie@kernel.org>2016-07-14 12:28:31 -0400
commit60a9a964420912a4c4b66efd210d98006177695a (patch)
tree4a1e1b0f832187929afb3ef768c752c49a16614b
parent1ada32ede94fc91ff0f3236fcc70ae74dd0c2cb0 (diff)
spi: s3c64xx: rename goto labels to meaningful names
The goto labels of the style of err4: err3: err2: err1: are complex to insert in between new errors without renaming all the goto statements. Replace the errX naming style to meaningful names in order to make it easier to insert new goto exit points. Signed-off-by: Andi Shyti <andi.shyti@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Michael Turquette <mturquette@baylibre.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-s3c64xx.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 001c9ebf884d..0a93eb98c2b6 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1078,7 +1078,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
1078 if (ret < 0) { 1078 if (ret < 0) {
1079 dev_err(&pdev->dev, "failed to get alias id, errno %d\n", 1079 dev_err(&pdev->dev, "failed to get alias id, errno %d\n",
1080 ret); 1080 ret);
1081 goto err0; 1081 goto err_deref_master;
1082 } 1082 }
1083 sdd->port_id = ret; 1083 sdd->port_id = ret;
1084 } else { 1084 } else {
@@ -1116,13 +1116,13 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
1116 sdd->regs = devm_ioremap_resource(&pdev->dev, mem_res); 1116 sdd->regs = devm_ioremap_resource(&pdev->dev, mem_res);
1117 if (IS_ERR(sdd->regs)) { 1117 if (IS_ERR(sdd->regs)) {
1118 ret = PTR_ERR(sdd->regs); 1118 ret = PTR_ERR(sdd->regs);
1119 goto err0; 1119 goto err_deref_master;
1120 } 1120 }
1121 1121
1122 if (sci->cfg_gpio && sci->cfg_gpio()) { 1122 if (sci->cfg_gpio && sci->cfg_gpio()) {
1123 dev_err(&pdev->dev, "Unable to config gpio\n"); 1123 dev_err(&pdev->dev, "Unable to config gpio\n");
1124 ret = -EBUSY; 1124 ret = -EBUSY;
1125 goto err0; 1125 goto err_deref_master;
1126 } 1126 }
1127 1127
1128 /* Setup clocks */ 1128 /* Setup clocks */
@@ -1130,13 +1130,13 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
1130 if (IS_ERR(sdd->clk)) { 1130 if (IS_ERR(sdd->clk)) {
1131 dev_err(&pdev->dev, "Unable to acquire clock 'spi'\n"); 1131 dev_err(&pdev->dev, "Unable to acquire clock 'spi'\n");
1132 ret = PTR_ERR(sdd->clk); 1132 ret = PTR_ERR(sdd->clk);
1133 goto err0; 1133 goto err_deref_master;
1134 } 1134 }
1135 1135
1136 if (clk_prepare_enable(sdd->clk)) { 1136 if (clk_prepare_enable(sdd->clk)) {
1137 dev_err(&pdev->dev, "Couldn't enable clock 'spi'\n"); 1137 dev_err(&pdev->dev, "Couldn't enable clock 'spi'\n");
1138 ret = -EBUSY; 1138 ret = -EBUSY;
1139 goto err0; 1139 goto err_deref_master;
1140 } 1140 }
1141 1141
1142 sprintf(clk_name, "spi_busclk%d", sci->src_clk_nr); 1142 sprintf(clk_name, "spi_busclk%d", sci->src_clk_nr);
@@ -1145,13 +1145,13 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
1145 dev_err(&pdev->dev, 1145 dev_err(&pdev->dev,
1146 "Unable to acquire clock '%s'\n", clk_name); 1146 "Unable to acquire clock '%s'\n", clk_name);
1147 ret = PTR_ERR(sdd->src_clk); 1147 ret = PTR_ERR(sdd->src_clk);
1148 goto err2; 1148 goto err_disable_clk;
1149 } 1149 }
1150 1150
1151 if (clk_prepare_enable(sdd->src_clk)) { 1151 if (clk_prepare_enable(sdd->src_clk)) {
1152 dev_err(&pdev->dev, "Couldn't enable clock '%s'\n", clk_name); 1152 dev_err(&pdev->dev, "Couldn't enable clock '%s'\n", clk_name);
1153 ret = -EBUSY; 1153 ret = -EBUSY;
1154 goto err2; 1154 goto err_disable_clk;
1155 } 1155 }
1156 1156
1157 pm_runtime_set_autosuspend_delay(&pdev->dev, AUTOSUSPEND_TIMEOUT); 1157 pm_runtime_set_autosuspend_delay(&pdev->dev, AUTOSUSPEND_TIMEOUT);
@@ -1171,7 +1171,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
1171 if (ret != 0) { 1171 if (ret != 0) {
1172 dev_err(&pdev->dev, "Failed to request IRQ %d: %d\n", 1172 dev_err(&pdev->dev, "Failed to request IRQ %d: %d\n",
1173 irq, ret); 1173 irq, ret);
1174 goto err3; 1174 goto err_pm_put;
1175 } 1175 }
1176 1176
1177 writel(S3C64XX_SPI_INT_RX_OVERRUN_EN | S3C64XX_SPI_INT_RX_UNDERRUN_EN | 1177 writel(S3C64XX_SPI_INT_RX_OVERRUN_EN | S3C64XX_SPI_INT_RX_UNDERRUN_EN |
@@ -1181,7 +1181,7 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
1181 ret = devm_spi_register_master(&pdev->dev, master); 1181 ret = devm_spi_register_master(&pdev->dev, master);
1182 if (ret != 0) { 1182 if (ret != 0) {
1183 dev_err(&pdev->dev, "cannot register SPI master: %d\n", ret); 1183 dev_err(&pdev->dev, "cannot register SPI master: %d\n", ret);
1184 goto err3; 1184 goto err_pm_put;
1185 } 1185 }
1186 1186
1187 dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached\n", 1187 dev_dbg(&pdev->dev, "Samsung SoC SPI Driver loaded for Bus SPI-%d with %d Slaves attached\n",
@@ -1195,15 +1195,15 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
1195 1195
1196 return 0; 1196 return 0;
1197 1197
1198err3: 1198err_pm_put:
1199 pm_runtime_put_noidle(&pdev->dev); 1199 pm_runtime_put_noidle(&pdev->dev);
1200 pm_runtime_disable(&pdev->dev); 1200 pm_runtime_disable(&pdev->dev);
1201 pm_runtime_set_suspended(&pdev->dev); 1201 pm_runtime_set_suspended(&pdev->dev);
1202 1202
1203 clk_disable_unprepare(sdd->src_clk); 1203 clk_disable_unprepare(sdd->src_clk);
1204err2: 1204err_disable_clk:
1205 clk_disable_unprepare(sdd->clk); 1205 clk_disable_unprepare(sdd->clk);
1206err0: 1206err_deref_master:
1207 spi_master_put(master); 1207 spi_master_put(master);
1208 1208
1209 return ret; 1209 return ret;