If bgpio_map returns NULL then err should always be set.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
*err = 0;
r = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
- if (!r)
+ if (!r) {
+ *err = -EINVAL;
return NULL;
+ }
sz = resource_size(r);
if (sz != sane_sz) {
sz = resource_size(r);
dat = bgpio_map(pdev, "dat", sz, &err);
- if (!dat)
- return err ? err : -EINVAL;
+ if (err)
+ return err;
set = bgpio_map(pdev, "set", sz, &err);
if (err)