OSDN Git Service

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)
commit8a7b179781e865ca2c7fe4ce9a7976f45c070f53
treea7da48b36573fe1f382b49df1325b6595d2f6662
parent827a9b8bbfdc976775eb0dc650d8485081271e27
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