From: Guenter Roeck Date: Sun, 1 Oct 2017 20:40:18 +0000 (-0700) Subject: Fix mmio resource request X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=68a88d99b78acd3d2f3a4a07921cd5dbc7782a82;p=groeck-it87 Fix mmio resource request We have to request a memory resource with IORESOURCE_MEM. Signed-off-by: Guenter Roeck --- diff --git a/it87.c b/it87.c index 4654485..9d6d474 100644 --- a/it87.c +++ b/it87.c @@ -3885,15 +3885,14 @@ static int it87_probe(struct platform_device *pdev) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_IO, 0); - if (!res) - return -EINVAL; - if (res->flags & IORESOURCE_IO) { + if (res) { if (!devm_request_region(dev, res->start, IT87_EC_EXTENT, DRVNAME)) { dev_err(dev, "Failed to request region %pR\n", res); return -EBUSY; } } else { + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); data->mmio = devm_ioremap_resource(dev, res); if (IS_ERR(data->mmio)) return PTR_ERR(data->mmio);