mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
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>
This commit is contained in:
parent
4b83555d50
commit
a5ea13f025
4 changed files with 18 additions and 8 deletions
|
@ -702,9 +702,11 @@ static int pmic_gpio_probe(struct platform_device *pdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
npins = of_irq_count(dev->of_node);
|
npins = platform_irq_count(pdev);
|
||||||
if (!npins)
|
if (!npins)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
if (npins < 0)
|
||||||
|
return npins;
|
||||||
|
|
||||||
BUG_ON(npins > ARRAY_SIZE(pmic_gpio_groups));
|
BUG_ON(npins > ARRAY_SIZE(pmic_gpio_groups));
|
||||||
|
|
||||||
|
|
|
@ -804,9 +804,11 @@ static int pmic_mpp_probe(struct platform_device *pdev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
npins = of_irq_count(dev->of_node);
|
npins = platform_irq_count(pdev);
|
||||||
if (!npins)
|
if (!npins)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
if (npins < 0)
|
||||||
|
return npins;
|
||||||
|
|
||||||
BUG_ON(npins > ARRAY_SIZE(pmic_mpp_groups));
|
BUG_ON(npins > ARRAY_SIZE(pmic_mpp_groups));
|
||||||
|
|
||||||
|
|
|
@ -667,16 +667,19 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
|
||||||
struct pinctrl_pin_desc *pins;
|
struct pinctrl_pin_desc *pins;
|
||||||
struct pm8xxx_gpio *pctrl;
|
struct pm8xxx_gpio *pctrl;
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i, npins;
|
||||||
|
|
||||||
pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
|
pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
|
||||||
if (!pctrl)
|
if (!pctrl)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
pctrl->dev = &pdev->dev;
|
pctrl->dev = &pdev->dev;
|
||||||
pctrl->npins = of_irq_count(pdev->dev.of_node);
|
npins = platform_irq_count(pdev);
|
||||||
if (!pctrl->npins)
|
if (!npins)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
if (npins < 0)
|
||||||
|
return npins;
|
||||||
|
pctrl->npins = npins;
|
||||||
|
|
||||||
pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL);
|
pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL);
|
||||||
if (!pctrl->regmap) {
|
if (!pctrl->regmap) {
|
||||||
|
|
|
@ -758,16 +758,19 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev)
|
||||||
struct pinctrl_pin_desc *pins;
|
struct pinctrl_pin_desc *pins;
|
||||||
struct pm8xxx_mpp *pctrl;
|
struct pm8xxx_mpp *pctrl;
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i, npins;
|
||||||
|
|
||||||
pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
|
pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
|
||||||
if (!pctrl)
|
if (!pctrl)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
pctrl->dev = &pdev->dev;
|
pctrl->dev = &pdev->dev;
|
||||||
pctrl->npins = of_irq_count(pdev->dev.of_node);
|
npins = platform_irq_count(pdev);
|
||||||
if (!pctrl->npins)
|
if (!npins)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
if (npins < 0)
|
||||||
|
return npins;
|
||||||
|
pctrl->npins = npins;
|
||||||
|
|
||||||
pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL);
|
pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL);
|
||||||
if (!pctrl->regmap) {
|
if (!pctrl->regmap) {
|
||||||
|
|
Loading…
Reference in a new issue