aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/twl6040.c
diff options
context:
space:
mode:
authorFlorian Vaussard <florian.vaussard@epfl.ch>2014-02-25 08:28:19 -0500
committerLee Jones <lee.jones@linaro.org>2014-03-19 04:58:27 -0400
commit89d68998308e16c49ce18b402d5f702d5a1767e5 (patch)
treeefac6e0183b12c6c9bac78755eae15746a9496e5 /drivers/mfd/twl6040.c
parentf8935e1cfcccd4904ee1bd1420aa781d43175479 (diff)
mfd: twl6040: Check for error when reading revision register
We may have an error when reading the revision register, so check for the returned value. Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Florian Vaussard <florian.vaussard@epfl.ch> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/twl6040.c')
-rw-r--r--drivers/mfd/twl6040.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c
index f15114f8c258..6e88f25832fb 100644
--- a/drivers/mfd/twl6040.c
+++ b/drivers/mfd/twl6040.c
@@ -661,6 +661,11 @@ static int twl6040_probe(struct i2c_client *client,
661 init_completion(&twl6040->ready); 661 init_completion(&twl6040->ready);
662 662
663 twl6040->rev = twl6040_reg_read(twl6040, TWL6040_REG_ASICREV); 663 twl6040->rev = twl6040_reg_read(twl6040, TWL6040_REG_ASICREV);
664 if (twl6040->rev < 0) {
665 dev_err(&client->dev, "Failed to read revision register: %d\n",
666 twl6040->rev);
667 goto gpio_err;
668 }
664 669
665 /* ERRATA: Automatic power-up is not possible in ES1.0 */ 670 /* ERRATA: Automatic power-up is not possible in ES1.0 */
666 if (twl6040_get_revid(twl6040) > TWL6040_REV_ES1_0) 671 if (twl6040_get_revid(twl6040) > TWL6040_REV_ES1_0)