drivers: sensor: Check i2c device pointer is non-null in bq274xx
Fixes the bq274xx sensor driver to check the i2c device pointer is non-null, rather than the bq274xx sensor device pointer. This appears to be the originally intended check based on the LOG_ERR message. Coverity CID: 210035 Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
parent
189ae8c890
commit
4475959285
1 changed files with 1 additions and 1 deletions
|
@ -365,7 +365,7 @@ static int bq274xx_gauge_init(struct device *dev)
|
|||
(uint16_t)config->design_capacity / (0.1 * config->taper_current);
|
||||
|
||||
bq274xx->i2c = device_get_binding(config->bus_name);
|
||||
if (bq274xx == NULL) {
|
||||
if (bq274xx->i2c == NULL) {
|
||||
LOG_ERR("Could not get pointer to %s device.",
|
||||
config->bus_name);
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue