mfd: ti_am335x_tscadc: Fix static checker warning
authorVignesh Raghavendra <vigneshr@ti.com>
Sat, 9 Nov 2019 05:06:18 +0000 (10:36 +0530)
committerLee Jones <lee.jones@linaro.org>
Mon, 11 Nov 2019 11:26:26 +0000 (11:26 +0000)
commitde98a43eb76b8442c02a2fe31c2a50d72cf6ded3
tree30b9f7ff7a9bc44ff2f20c82cd9e8272107c09ec
parentcfca8bb24e0c7e7241e8ef8af27881dd12b4543e
mfd: ti_am335x_tscadc: Fix static checker warning

It is possible that platform_get_resource() might return NULL and
therefore code needs to check for this condition before
de-referencing the pointer.

Therefore move the de-referencing of 'res' pointer after
devm_ioremap_resource() which would have checked the validity of the
pointer.

Reported-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/ti_am335x_tscadc.c