Merge "mhi: core: Do a null pointer check before reading debug registers"
This commit is contained in:
commit
5e908f6261
1 changed files with 3 additions and 1 deletions
|
@ -2776,7 +2776,7 @@ void mhi_debug_reg_dump(struct mhi_controller *mhi_cntrl)
|
|||
struct {
|
||||
const char *name;
|
||||
int offset;
|
||||
void *base;
|
||||
void __iomem *base;
|
||||
} debug_reg[] = {
|
||||
{ "MHI_CNTRL", MHICTRL, mhi_base},
|
||||
{ "MHI_STATUS", MHISTATUS, mhi_base},
|
||||
|
@ -2806,6 +2806,8 @@ void mhi_debug_reg_dump(struct mhi_controller *mhi_cntrl)
|
|||
TO_MHI_STATE_STR(state));
|
||||
|
||||
for (i = 0; debug_reg[i].name; i++) {
|
||||
if (!debug_reg[i].base)
|
||||
continue;
|
||||
ret = mhi_read_reg(mhi_cntrl, debug_reg[i].base,
|
||||
debug_reg[i].offset, &val);
|
||||
MHI_LOG("reg:%s val:0x%x, ret:%d\n", debug_reg[i].name, val,
|
||||
|
|
Loading…
Reference in a new issue