.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2016 NVIDIA Corporation |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify |
---|
5 | | - * it under the terms of the GNU General Public License version 2 as |
---|
6 | | - * published by the Free Software Foundation. |
---|
7 | 4 | */ |
---|
8 | 5 | |
---|
9 | 6 | #include <linux/reset-controller.h> |
---|
.. | .. |
---|
23 | 20 | struct tegra_bpmp *bpmp = to_tegra_bpmp(rstc); |
---|
24 | 21 | struct mrq_reset_request request; |
---|
25 | 22 | struct tegra_bpmp_message msg; |
---|
| 23 | + int err; |
---|
26 | 24 | |
---|
27 | 25 | memset(&request, 0, sizeof(request)); |
---|
28 | 26 | request.cmd = command; |
---|
.. | .. |
---|
33 | 31 | msg.tx.data = &request; |
---|
34 | 32 | msg.tx.size = sizeof(request); |
---|
35 | 33 | |
---|
36 | | - return tegra_bpmp_transfer(bpmp, &msg); |
---|
| 34 | + err = tegra_bpmp_transfer(bpmp, &msg); |
---|
| 35 | + if (err) |
---|
| 36 | + return err; |
---|
| 37 | + if (msg.rx.ret) |
---|
| 38 | + return -EINVAL; |
---|
| 39 | + |
---|
| 40 | + return 0; |
---|
37 | 41 | } |
---|
38 | 42 | |
---|
39 | 43 | static int tegra_bpmp_reset_module(struct reset_controller_dev *rstc, |
---|