Skip to content

Commit 5ff132c

Browse files
committed
Merge tag 'for-v4.8-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull power supply fixes from Sebastian Reichel. * tag 'for-v4.8-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power_supply: tps65217-charger: fix missing platform_set_drvdata() power: reset: hisi-reboot: Unmap region obtained by of_iomap power: reset: reboot-mode: fix build error of missing ioremap/iounmap on UM power: supply: max17042_battery: fix model download bug.
2 parents 3ec60b9 + 33e7664 commit 5ff132c

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

drivers/power/max17042_battery.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -457,13 +457,16 @@ static inline void max17042_write_model_data(struct max17042_chip *chip,
457457
}
458458

459459
static inline void max17042_read_model_data(struct max17042_chip *chip,
460-
u8 addr, u32 *data, int size)
460+
u8 addr, u16 *data, int size)
461461
{
462462
struct regmap *map = chip->regmap;
463463
int i;
464+
u32 tmp;
464465

465-
for (i = 0; i < size; i++)
466-
regmap_read(map, addr + i, &data[i]);
466+
for (i = 0; i < size; i++) {
467+
regmap_read(map, addr + i, &tmp);
468+
data[i] = (u16)tmp;
469+
}
467470
}
468471

469472
static inline int max17042_model_data_compare(struct max17042_chip *chip,
@@ -486,7 +489,7 @@ static int max17042_init_model(struct max17042_chip *chip)
486489
{
487490
int ret;
488491
int table_size = ARRAY_SIZE(chip->pdata->config_data->cell_char_tbl);
489-
u32 *temp_data;
492+
u16 *temp_data;
490493

491494
temp_data = kcalloc(table_size, sizeof(*temp_data), GFP_KERNEL);
492495
if (!temp_data)
@@ -501,7 +504,7 @@ static int max17042_init_model(struct max17042_chip *chip)
501504
ret = max17042_model_data_compare(
502505
chip,
503506
chip->pdata->config_data->cell_char_tbl,
504-
(u16 *)temp_data,
507+
temp_data,
505508
table_size);
506509

507510
max10742_lock_model(chip);
@@ -514,7 +517,7 @@ static int max17042_verify_model_lock(struct max17042_chip *chip)
514517
{
515518
int i;
516519
int table_size = ARRAY_SIZE(chip->pdata->config_data->cell_char_tbl);
517-
u32 *temp_data;
520+
u16 *temp_data;
518521
int ret = 0;
519522

520523
temp_data = kcalloc(table_size, sizeof(*temp_data), GFP_KERNEL);

drivers/power/reset/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ config REBOOT_MODE
200200
config SYSCON_REBOOT_MODE
201201
tristate "Generic SYSCON regmap reboot mode driver"
202202
depends on OF
203+
depends on MFD_SYSCON
203204
select REBOOT_MODE
204-
select MFD_SYSCON
205205
help
206206
Say y here will enable reboot mode driver. This will
207207
get reboot mode arguments and store it in SYSCON mapped

drivers/power/reset/hisi-reboot.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@ static int hisi_reboot_probe(struct platform_device *pdev)
5353

5454
if (of_property_read_u32(np, "reboot-offset", &reboot_offset) < 0) {
5555
pr_err("failed to find reboot-offset property\n");
56+
iounmap(base);
5657
return -EINVAL;
5758
}
5859

5960
err = register_restart_handler(&hisi_restart_nb);
60-
if (err)
61+
if (err) {
6162
dev_err(&pdev->dev, "cannot register restart handler (err=%d)\n",
6263
err);
64+
iounmap(base);
65+
}
6366

6467
return err;
6568
}

drivers/power/tps65217_charger.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ static int tps65217_charger_probe(struct platform_device *pdev)
206206
if (!charger)
207207
return -ENOMEM;
208208

209+
platform_set_drvdata(pdev, charger);
209210
charger->tps = tps;
210211
charger->dev = &pdev->dev;
211212

0 commit comments

Comments
 (0)