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

bus: bt1-axi: Optimize the return points in the driver

It's better to have a single return statement where it's applicable
instead of returning from a conditional statement if-clause. Let's
do this in the request registers, clock and IRQ methods.

Link: https://lore.kernel.org/r/20200528145050.5203-5-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Cc: Olof Johansson <olof@lixom.net>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: soc@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Serge Semin and committed by
Arnd Bergmann
7f57416f b7cb430d

+6 -12
+6 -12
drivers/bus/bt1-axi.c
··· 124 124 } 125 125 126 126 axi->qos_regs = devm_platform_ioremap_resource_byname(pdev, "qos"); 127 - if (IS_ERR(axi->qos_regs)) { 127 + if (IS_ERR(axi->qos_regs)) 128 128 dev_err(dev, "Couldn't map AXI-bus QoS registers\n"); 129 - return PTR_ERR(axi->qos_regs); 130 - } 131 129 132 - return 0; 130 + return PTR_ERR_OR_ZERO(axi->qos_regs); 133 131 } 134 132 135 133 static int bt1_axi_request_rst(struct bt1_axi *axi) ··· 171 173 } 172 174 173 175 ret = devm_add_action_or_reset(axi->dev, bt1_axi_disable_clk, axi); 174 - if (ret) { 176 + if (ret) 175 177 dev_err(axi->dev, "Can't add AXI clock disable action\n"); 176 - return ret; 177 - } 178 178 179 - return 0; 179 + return ret; 180 180 } 181 181 182 182 static int bt1_axi_request_irq(struct bt1_axi *axi) ··· 188 192 189 193 ret = devm_request_irq(axi->dev, axi->irq, bt1_axi_isr, IRQF_SHARED, 190 194 "bt1-axi", axi); 191 - if (ret) { 195 + if (ret) 192 196 dev_err(axi->dev, "Couldn't request AXI EHB IRQ\n"); 193 - return ret; 194 - } 195 197 196 - return 0; 198 + return ret; 197 199 } 198 200 199 201 static ssize_t count_show(struct device *dev,