Merge "power: reboot-reason: Check nvmen write return value"
This commit is contained in:
commit
3b2597cb75
@ -1,6 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2019, 2021 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
#define pr_fmt(fmt) "qcom-reboot-reason: %s: " fmt, __func__
|
||||
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
@ -38,6 +40,7 @@ static struct poweroff_reason reasons[] = {
|
||||
static int qcom_reboot_reason_reboot(struct notifier_block *this,
|
||||
unsigned long event, void *ptr)
|
||||
{
|
||||
int rc;
|
||||
char *cmd = ptr;
|
||||
struct qcom_reboot_reason *reboot = container_of(this,
|
||||
struct qcom_reboot_reason, reboot_nb);
|
||||
@ -47,9 +50,11 @@ static int qcom_reboot_reason_reboot(struct notifier_block *this,
|
||||
return NOTIFY_OK;
|
||||
for (reason = reasons; reason->cmd; reason++) {
|
||||
if (!strcmp(cmd, reason->cmd)) {
|
||||
nvmem_cell_write(reboot->nvmem_cell,
|
||||
rc = nvmem_cell_write(reboot->nvmem_cell,
|
||||
&reason->pon_reason,
|
||||
sizeof(reason->pon_reason));
|
||||
if (rc < 0)
|
||||
pr_err("PON reason store failed, rc=%d\n", rc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user