summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2016-01-07 02:37:41 +0100
committerLinus Walleij <linus.walleij@linaro.org>2016-01-07 10:35:52 +0100
commita5ea13f025e7bf3bb280a22f5fe63b7159358932 (patch)
treeedfd504d4b5f402c05d4a214b409edc68175b8b4 /drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
parentdriver-core: platform: Add platform_irq_count() (diff)
downloadlinux-a5ea13f025e7bf3bb280a22f5fe63b7159358932.tar.xz
linux-a5ea13f025e7bf3bb280a22f5fe63b7159358932.zip
pinctrl: qcom: Use platform_irq_count() instead of of_irq_count()
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>
Diffstat (limited to 'drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c')
-rw-r--r--drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
index 78fa2281116d..e51176ec83d2 100644
--- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
+++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c
@@ -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) {