mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-12 02:40:53 +00:00
gpio: Fix error checking in the function device_pca957x_init
This fixes error checking in the function device_pca957x_init to properly check and return error code values from the calls to the function pca953x_write_regs if they fail as to properly signal callers when a error occurs due a failure when writing registers for this gpio based device. Signed-off-by: Nicholas Krause <xerofoify@gmail.com> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
49a5bd880c
commit
c75a377204
@ -635,11 +635,15 @@ static int device_pca957x_init(struct pca953x_chip *chip, u32 invert)
|
|||||||
memset(val, 0xFF, NBANK(chip));
|
memset(val, 0xFF, NBANK(chip));
|
||||||
else
|
else
|
||||||
memset(val, 0, NBANK(chip));
|
memset(val, 0, NBANK(chip));
|
||||||
pca953x_write_regs(chip, PCA957X_INVRT, val);
|
ret = pca953x_write_regs(chip, PCA957X_INVRT, val);
|
||||||
|
if (ret)
|
||||||
|
goto out;
|
||||||
|
|
||||||
/* To enable register 6, 7 to control pull up and pull down */
|
/* To enable register 6, 7 to control pull up and pull down */
|
||||||
memset(val, 0x02, NBANK(chip));
|
memset(val, 0x02, NBANK(chip));
|
||||||
pca953x_write_regs(chip, PCA957X_BKEN, val);
|
ret = pca953x_write_regs(chip, PCA957X_BKEN, val);
|
||||||
|
if (ret)
|
||||||
|
goto out;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
out:
|
out:
|
||||||
|
Loading…
Reference in New Issue
Block a user