resource: Let request_ioport_region return an error pointer
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
ed6e965824
commit
d5a82eb095
|
@ -146,7 +146,7 @@ struct resource *request_ioport_region(const char *name,
|
|||
|
||||
res = __request_region(&ioport_resource, name, start, end);
|
||||
if (IS_ERR(res))
|
||||
return NULL;
|
||||
return ERR_CAST(res);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -353,8 +353,8 @@ static int ns16550_init_ioport(struct device_d *dev, struct ns16550_priv *priv)
|
|||
return PTR_ERR(res);
|
||||
|
||||
res = request_ioport_region(dev_name(dev), res->start, res->end);
|
||||
if (!res)
|
||||
return -ENODEV;
|
||||
if (IS_ERR(res))
|
||||
return PTR_ERR(res);
|
||||
|
||||
priv->iobase = res->start;
|
||||
|
||||
|
|
Loading…
Reference in New Issue