]> git.sur5r.net Git - groeck-it87/commitdiff
Fix mmio resource request
authorGuenter Roeck <linux@roeck-us.net>
Sun, 1 Oct 2017 20:40:18 +0000 (13:40 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 1 Oct 2017 20:40:18 +0000 (13:40 -0700)
We have to request a memory resource with IORESOURCE_MEM.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
it87.c

diff --git a/it87.c b/it87.c
index 46544856c591cf07917aa526c96d3d20411b87df..9d6d47492d8aafdd4b9f7e2a5c8d3b05c503db75 100644 (file)
--- 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);