mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
f8935e1cfc
commit
89d6899830
1 changed files with 5 additions and 0 deletions
|
@ -661,6 +661,11 @@ static int twl6040_probe(struct i2c_client *client,
|
|||
init_completion(&twl6040->ready);
|
||||
|
||||
twl6040->rev = twl6040_reg_read(twl6040, TWL6040_REG_ASICREV);
|
||||
if (twl6040->rev < 0) {
|
||||
dev_err(&client->dev, "Failed to read revision register: %d\n",
|
||||
twl6040->rev);
|
||||
goto gpio_err;
|
||||
}
|
||||
|
||||
/* ERRATA: Automatic power-up is not possible in ES1.0 */
|
||||
if (twl6040_get_revid(twl6040) > TWL6040_REV_ES1_0)
|
||||
|
|
Loading…
Add table
Reference in a new issue