]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/irqchip/irq-mbigen.c
Merge branch 'ufs-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / drivers / irqchip / irq-mbigen.c
index d2306c821ebb594398d102433dcc66efcb2bf573..31d6b5a582d28a2b4fdd0d0c0f0bf9e6113a9e4d 100644 (file)
@@ -106,10 +106,7 @@ static inline void get_mbigen_type_reg(irq_hw_number_t hwirq,
 static inline void get_mbigen_clear_reg(irq_hw_number_t hwirq,
                                        u32 *mask, u32 *addr)
 {
-       unsigned int ofst;
-
-       hwirq -= RESERVED_IRQ_PER_MBIGEN_CHIP;
-       ofst = hwirq / 32 * 4;
+       unsigned int ofst = (hwirq / 32) * 4;
 
        *mask = 1 << (hwirq % 32);
        *addr = ofst + REG_MBIGEN_CLEAR_OFFSET;
@@ -337,9 +334,15 @@ static int mbigen_device_probe(struct platform_device *pdev)
        mgn_chip->pdev = pdev;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mgn_chip->base = devm_ioremap_resource(&pdev->dev, res);
-       if (IS_ERR(mgn_chip->base))
-               return PTR_ERR(mgn_chip->base);
+       if (!res)
+               return -EINVAL;
+
+       mgn_chip->base = devm_ioremap(&pdev->dev, res->start,
+                                     resource_size(res));
+       if (!mgn_chip->base) {
+               dev_err(&pdev->dev, "failed to ioremap %pR\n", res);
+               return -ENOMEM;
+       }
 
        if (IS_ENABLED(CONFIG_OF) && pdev->dev.of_node)
                err = mbigen_of_create_domain(pdev, mgn_chip);