]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
pinctrl: qcom: Use platform_irq_count() instead of of_irq_count()
authorStephen Boyd <sboyd@codeaurora.org>
Thu, 7 Jan 2016 01:37:41 +0000 (17:37 -0800)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 7 Jan 2016 09:35:52 +0000 (10:35 +0100)
of_irq_count() is not an exported symbol (and it shouldn't be
used by platform drivers anyway) so use platform_irq_count()
instead. This allows us to make the qcom pinctrl drivers modular
again.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Andy Gross <andy.gross@linaro.org>
Cc: Bjorn Andersson <bjorn@kryo.se>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
drivers/pinctrl/qcom/pinctrl-spmi-mpp.c
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c

index 4eea62ace50c36b7015fde6f96b402f99c7bb704..77f6a5cb10081f80dba4a39e1e6711f5da0e9277 100644 (file)
@@ -702,9 +702,11 @@ static int pmic_gpio_probe(struct platform_device *pdev)
                return ret;
        }
 
-       npins = of_irq_count(dev->of_node);
+       npins = platform_irq_count(pdev);
        if (!npins)
                return -EINVAL;
+       if (npins < 0)
+               return npins;
 
        BUG_ON(npins > ARRAY_SIZE(pmic_gpio_groups));
 
index 8841bb75fc9ba24a9a50f950d4e65c0f43f42cb7..2df4f29175ae9cd588a398af8a62cfdeb097f267 100644 (file)
@@ -804,9 +804,11 @@ static int pmic_mpp_probe(struct platform_device *pdev)
                return ret;
        }
 
-       npins = of_irq_count(dev->of_node);
+       npins = platform_irq_count(pdev);
        if (!npins)
                return -EINVAL;
+       if (npins < 0)
+               return npins;
 
        BUG_ON(npins > ARRAY_SIZE(pmic_mpp_groups));
 
index 78fa2281116d684f39cd6313fe48de048dd0379a..e51176ec83d2b50f092729ab0515bc0fa604d01b 100644 (file)
@@ -667,16 +667,19 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
        struct pinctrl_pin_desc *pins;
        struct pm8xxx_gpio *pctrl;
        int ret;
-       int i;
+       int i, npins;
 
        pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
        if (!pctrl)
                return -ENOMEM;
 
        pctrl->dev = &pdev->dev;
-       pctrl->npins = of_irq_count(pdev->dev.of_node);
-       if (!pctrl->npins)
+       npins = platform_irq_count(pdev);
+       if (!npins)
                return -EINVAL;
+       if (npins < 0)
+               return npins;
+       pctrl->npins = npins;
 
        pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL);
        if (!pctrl->regmap) {
index 0831063da54cc088ea4d66bd2422eb06647ab273..e9f01de51e182e41a3fbfb9e4d4f565d0c131fdd 100644 (file)
@@ -758,16 +758,19 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
        struct pinctrl_pin_desc *pins;
        struct pm8xxx_mpp *pctrl;
        int ret;
-       int i;
+       int i, npins;
 
        pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
        if (!pctrl)
                return -ENOMEM;
 
        pctrl->dev = &pdev->dev;
-       pctrl->npins = of_irq_count(pdev->dev.of_node);
-       if (!pctrl->npins)
+       npins = platform_irq_count(pdev);
+       if (!npins)
                return -EINVAL;
+       if (npins < 0)
+               return npins;
+       pctrl->npins = npins;
 
        pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL);
        if (!pctrl->regmap) {