]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: stp-xway: simplify error handling in xway_stp_probe()
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Tue, 2 Jul 2019 22:32:45 +0000 (00:32 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 4 Jul 2019 07:38:47 +0000 (09:38 +0200)
commit901d75154bc13f5cf912ae69479198a31317199c
treea7da48b36573fe1f382b49df1325b6595d2f6662
parent697ea7632480c8ab6bf763de0d7d8160dc94044b
gpio: stp-xway: simplify error handling in xway_stp_probe()

Return early if devm_gpiochip_add_data() returns an error instead of
having two consecutive "if (!ret) ..." statements.

Also make xway_stp_hw_init() return void because it unconditionally
returns 0. While here also update the kerneldoc comment for
xway_stp_hw_init().

These changes makes the error handling within the driver consistent.
No functional changes intended.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20190702223248.31934-2-martin.blumenstingl@googlemail.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-stp-xway.c