Merge "power: supply: qcom: fix the regmap typecast"

This commit is contained in:
qctecmdr 2023-02-27 12:32:57 -08:00 committed by Gerrit - the friendly Code Review server
commit ab542096ab

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#define pr_fmt(fmt) "SCHG-FLASH: %s: " fmt, __func__
@ -36,7 +36,14 @@ struct schgm_flash_dev {
static int smblib_read(struct schgm_flash_dev *chg, u16 addr, u8 *val)
{
return regmap_read(chg->regmap, addr, (unsigned int *) val);
unsigned int value;
int rc = 0;
rc = regmap_read(chg->regmap, addr, &value);
if (rc >= 0)
*val = (u8)value;
return rc;
}
static int smblib_write(struct schgm_flash_dev *chg, u16 addr, u8 val)