mirror of https://github.com/torvalds/linux.git
gpio: qixis-fpga: Fix a NULL vs IS_ERR() bug in probe()
The devm_platform_ioremap_resource() function doesn't return NULL, it
returns error pointers. Fix the checking to match.
Fixes: e88500247d ("gpio: add QIXIS FPGA GPIO controller")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Michael Walle <mwalle@kernel.org>
Link: https://lore.kernel.org/r/aPsaaf0h343Ba7c1@stanley.mountain
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
96fbc8050d
commit
9452252dff
|
|
@ -56,8 +56,8 @@ static int qixis_cpld_gpio_probe(struct platform_device *pdev)
|
||||||
* create our own from the MMIO space.
|
* create our own from the MMIO space.
|
||||||
*/
|
*/
|
||||||
reg = devm_platform_ioremap_resource(pdev, 0);
|
reg = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (!reg)
|
if (IS_ERR(reg))
|
||||||
return -ENODEV;
|
return PTR_ERR(reg);
|
||||||
|
|
||||||
regmap = devm_regmap_init_mmio(&pdev->dev, reg, ®map_config_8r_8v);
|
regmap = devm_regmap_init_mmio(&pdev->dev, reg, ®map_config_8r_8v);
|
||||||
if (!regmap)
|
if (!regmap)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue