- lp5521_read(client, LP5521_REG_R_CURRENT, &buf);
- if (buf != LP5521_REG_R_CURR_DEFAULT) {
- dev_err(&client->dev, "error in reseting chip\n");
+ ret = lp5521_read(client, LP5521_REG_R_CURRENT, &buf);
+ if (ret || buf != LP5521_REG_R_CURR_DEFAULT) {
+ dev_err(&client->dev, "error in resetting chip\n");