aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-01-11 20:05:39 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-01-11 20:05:39 -0800
commit581dbc8bfc47ab16c69a67cc20dafea378ddbc60 (patch)
tree6cbacd00aea6463ed5c6e035a0aef54c15f1b1e5 /drivers/base
parentMerge tag 'mmc-v4.5' of git://git.linaro.org/people/ulf.hansson/mmc (diff)
parentpinctrl: mediatek: Modify pinctrl bindings for mt2701 (diff)
downloadlinux-dev-581dbc8bfc47ab16c69a67cc20dafea378ddbc60.tar.xz
linux-dev-581dbc8bfc47ab16c69a67cc20dafea378ddbc60.zip
Merge tag 'pinctrl-v4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control updates from Linus Walleij: "This is the bulk of pin control patches for the v4.5 series. Notably I have a patch to driver core from Stephen Boyd in the pull request, this has been ACKed by Greg so it should be OK. The internal API needed some tweaking to allow modular Qualcomm pin controllers. There is a bit of development history in here but it should all add up nicely and has boiled in linux-next. For example I merged in v4.4-rc5 to get rid of some nasty merge conflicts. Summary: - New drivers: - PXA2xx pin controller support - Broadcom NSP pin controller support - New subdrivers: - Samsung EXYNOS5410 support - Qualcomm MSM8996 support - Qualcomm PM8994 support - Qualcomm PM8994 MPP support - Allwinner sunxi H3 support - Allwinner sunxi A80 support - Rockchip RK3228 support - Rename the Cygnus pinctrl driver to "iproc" as it is more generic than was originally thought. - A bunch of Lantiq/Xway updates especially from the OpenWRT people. - Several refactorings for the Super-H SH PFC pin controllers. Adding SCIF_CLK support. - Several fixes to the Atlas 7 driver. - Various fixes all over the place" * tag 'pinctrl-v4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (91 commits) pinctrl: mediatek: Modify pinctrl bindings for mt2701 Revert "pinctrl: qcom: make PMIC drivers bool" pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() driver-core: platform: Add platform_irq_count() pinctrl: lantiq: 2 pins have the wrong mux list pinctrl: qcom: make PMIC drivers bool pinctrl: nsp-gpio: forever loop in nsp_gpio_get_strength() pinctrl: mediatek: convert to arch_initcall pinctrl: bcm2835: Fix memory leak in error path pinctrl: mediatek: add missing of_node_put pinctrl: rockchip: add missing of_node_put pinctrl: sh-pfc: add missing of_node_put pinctrl: sirf: add missing of_node_put pinctrl-tegra: add missing of_node_put pinctrl: sunxi: Add A80 special pin controller pinctrl: bcm/cygnys/iproc: fixup rebase issue pinctrl: fixup problematic flag MAINTAINERS: Add co-maintainer for Renesas Pin Controllers pinctrl: sh-pfc: r8a7791: add EtherAVB pin groups pinctrl: sh-pfc: r8a7795: Add SATA support ...
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/platform.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 1dd6d3bf1098..73e399466c6e 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -117,6 +117,26 @@ int platform_get_irq(struct platform_device *dev, unsigned int num)
EXPORT_SYMBOL_GPL(platform_get_irq);
/**
+ * platform_irq_count - Count the number of IRQs a platform device uses
+ * @dev: platform device
+ *
+ * Return: Number of IRQs a platform device uses or EPROBE_DEFER
+ */
+int platform_irq_count(struct platform_device *dev)
+{
+ int ret, nr = 0;
+
+ while ((ret = platform_get_irq(dev, nr)) >= 0)
+ nr++;
+
+ if (ret == -EPROBE_DEFER)
+ return ret;
+
+ return nr;
+}
+EXPORT_SYMBOL_GPL(platform_irq_count);
+
+/**
* platform_get_resource_byname - get a resource for a device by name
* @dev: platform device
* @type: resource type