diff options
author | Vignesh Raghavendra <vigneshr@ti.com> | 2019-11-09 10:36:18 +0530 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2019-11-11 11:26:26 +0000 |
commit | de98a43eb76b8442c02a2fe31c2a50d72cf6ded3 (patch) | |
tree | 30b9f7ff7a9bc44ff2f20c82cd9e8272107c09ec /drivers/mfd | |
parent | cfca8bb24e0c7e7241e8ef8af27881dd12b4543e (diff) |
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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/ti_am335x_tscadc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c index fd111296b959..926c289cb040 100644 --- a/drivers/mfd/ti_am335x_tscadc.c +++ b/drivers/mfd/ti_am335x_tscadc.c @@ -182,11 +182,11 @@ static int ti_tscadc_probe(struct platform_device *pdev) tscadc->irq = err; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - tscadc->tscadc_phys_base = res->start; tscadc->tscadc_base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(tscadc->tscadc_base)) return PTR_ERR(tscadc->tscadc_base); + tscadc->tscadc_phys_base = res->start; tscadc->regmap = devm_regmap_init_mmio(&pdev->dev, tscadc->tscadc_base, &tscadc_regmap_config); if (IS_ERR(tscadc->regmap)) { |