summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2015-06-02 13:36:51 +0300
committerSebastian Reichel <sre@kernel.org>2015-06-02 20:58:19 +0200
commit23fa43a28d00bca79b28e145a34c0c7dcafd72bc (patch)
treeb11121f6ada4a7b034f9071bedef9a7f2fc419a8 /drivers/power
parente86d69dd786e94046b8f5be7df1b9a8226a40b2a (diff)
downloadtalos-obmc-linux-23fa43a28d00bca79b28e145a34c0c7dcafd72bc.tar.gz
talos-obmc-linux-23fa43a28d00bca79b28e145a34c0c7dcafd72bc.zip
power_supply: bq25890: make chip_id int
Smatch static checker correctly detected an impossible condition because chip_id was declared as u8, instead of int: drivers/power/bq25890_charger.c:843 bq25890_probe() warn: impossible condition '(bq->chip_id < 0) => (0-255 < 0)' Also, while at it, fix the return value too. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/bq25890_charger.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/bq25890_charger.c b/drivers/power/bq25890_charger.c
index c7b4903acd75..16b7c7bc987d 100644
--- a/drivers/power/bq25890_charger.c
+++ b/drivers/power/bq25890_charger.c
@@ -99,7 +99,7 @@ struct bq25890_device {
struct regmap *rmap;
struct regmap_field *rmap_fields[F_MAX_FIELDS];
- u8 chip_id;
+ int chip_id;
struct bq25890_init_data init_data;
struct bq25890_state state;
@@ -842,7 +842,7 @@ static int bq25890_probe(struct i2c_client *client,
bq->chip_id = bq25890_field_read(bq, F_PN);
if (bq->chip_id < 0) {
dev_err(dev, "Cannot read chip ID.\n");
- return ret;
+ return bq->chip_id;
}
if (bq->chip_id != BQ25890_ID) {
OpenPOWER on IntegriCloud