* [PATCH 0/3] Make qcom pinctrl drivers tristate again @ 2016-01-07 1:12 ` Stephen Boyd 0 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:12 UTC (permalink / raw) To: Linus Walleij Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Greg Kroah-Hartman, Andy Gross One of my recent changes to the qcom pinctrl drivers introduced a module build failure due to of_irq_count() missing an export. Rob doesn't want us to export that API though, so this series introduces platform_irq_count() and uses it in the pinctrl drivers. Linus changed the Kconfig to bool so that the build failure went away, so I've reverted that patch here after we fix the build failure with the new API. Greg, please ack the first patch so it can go through Linus' tree. Cc: Rob Herring <robh+dt@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Andy Gross <andy.gross@linaro.org> Stephen Boyd (3): driver-core: platform: Add platform_irq_count() pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() Revert "pinctrl: qcom: make PMIC drivers bool" drivers/base/platform.c | 20 ++++++++++++++++++++ drivers/pinctrl/qcom/Kconfig | 4 ++-- drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 4 +++- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 4 +++- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 9 ++++++--- drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 9 ++++++--- include/linux/platform_device.h | 1 + 7 files changed, 41 insertions(+), 10 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 0/3] Make qcom pinctrl drivers tristate again @ 2016-01-07 1:12 ` Stephen Boyd 0 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:12 UTC (permalink / raw) To: linux-arm-kernel One of my recent changes to the qcom pinctrl drivers introduced a module build failure due to of_irq_count() missing an export. Rob doesn't want us to export that API though, so this series introduces platform_irq_count() and uses it in the pinctrl drivers. Linus changed the Kconfig to bool so that the build failure went away, so I've reverted that patch here after we fix the build failure with the new API. Greg, please ack the first patch so it can go through Linus' tree. Cc: Rob Herring <robh+dt@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Andy Gross <andy.gross@linaro.org> Stephen Boyd (3): driver-core: platform: Add platform_irq_count() pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() Revert "pinctrl: qcom: make PMIC drivers bool" drivers/base/platform.c | 20 ++++++++++++++++++++ drivers/pinctrl/qcom/Kconfig | 4 ++-- drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 4 +++- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 4 +++- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 9 ++++++--- drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 9 ++++++--- include/linux/platform_device.h | 1 + 7 files changed, 41 insertions(+), 10 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 1/3] driver-core: platform: Add platform_irq_count() 2016-01-07 1:12 ` Stephen Boyd @ 2016-01-07 1:12 ` Stephen Boyd -1 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:12 UTC (permalink / raw) To: Linus Walleij Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Greg Kroah-Hartman, Andy Gross A recent patch added calls to of_irq_count() in the qcom pinctrl drivers and that caused module build failures because of_irq_count() is not an exported symbol. We shouldn't export of_irq_count() to modules because it's an internal OF API that shouldn't be used by drivers. Platform drivers should use platform device APIs instead. Therefore, add a platform_irq_count() API that mirrors the of_irq_count() API so that platform drivers can stay DT agnostic. Cc: Rob Herring <robh+dt@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Andy Gross <andy.gross@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> --- drivers/base/platform.c | 20 ++++++++++++++++++++ include/linux/platform_device.h | 1 + 2 files changed, 21 insertions(+) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index d77ed0c946dd..8dcbb266643b 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -118,6 +118,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 diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index dba40b1c41dc..03b755521fd9 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -52,6 +52,7 @@ extern void arch_setup_pdev_archdata(struct platform_device *); extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); extern int platform_get_irq(struct platform_device *, unsigned int); +extern int platform_irq_count(struct platform_device *); extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 1/3] driver-core: platform: Add platform_irq_count() @ 2016-01-07 1:12 ` Stephen Boyd 0 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:12 UTC (permalink / raw) To: linux-arm-kernel A recent patch added calls to of_irq_count() in the qcom pinctrl drivers and that caused module build failures because of_irq_count() is not an exported symbol. We shouldn't export of_irq_count() to modules because it's an internal OF API that shouldn't be used by drivers. Platform drivers should use platform device APIs instead. Therefore, add a platform_irq_count() API that mirrors the of_irq_count() API so that platform drivers can stay DT agnostic. Cc: Rob Herring <robh+dt@kernel.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Andy Gross <andy.gross@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> --- drivers/base/platform.c | 20 ++++++++++++++++++++ include/linux/platform_device.h | 1 + 2 files changed, 21 insertions(+) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index d77ed0c946dd..8dcbb266643b 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -118,6 +118,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 diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index dba40b1c41dc..03b755521fd9 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -52,6 +52,7 @@ extern void arch_setup_pdev_archdata(struct platform_device *); extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); extern int platform_get_irq(struct platform_device *, unsigned int); +extern int platform_irq_count(struct platform_device *); extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH 1/3] driver-core: platform: Add platform_irq_count() 2016-01-07 1:12 ` Stephen Boyd (?) @ 2016-01-07 1:15 ` Rob Herring -1 siblings, 0 replies; 32+ messages in thread From: Rob Herring @ 2016-01-07 1:15 UTC (permalink / raw) To: Stephen Boyd Cc: Linus Walleij, linux-kernel, linux-arm-msm, linux-arm-kernel, Greg Kroah-Hartman, Andy Gross On Wed, Jan 6, 2016 at 7:12 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: > A recent patch added calls to of_irq_count() in the qcom pinctrl > drivers and that caused module build failures because > of_irq_count() is not an exported symbol. We shouldn't export > of_irq_count() to modules because it's an internal OF API that > shouldn't be used by drivers. Platform drivers should use > platform device APIs instead. Therefore, add a platform_irq_count() > API that mirrors the of_irq_count() API so that platform drivers > can stay DT agnostic. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 1/3] driver-core: platform: Add platform_irq_count() @ 2016-01-07 1:15 ` Rob Herring 0 siblings, 0 replies; 32+ messages in thread From: Rob Herring @ 2016-01-07 1:15 UTC (permalink / raw) To: linux-arm-kernel On Wed, Jan 6, 2016 at 7:12 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: > A recent patch added calls to of_irq_count() in the qcom pinctrl > drivers and that caused module build failures because > of_irq_count() is not an exported symbol. We shouldn't export > of_irq_count() to modules because it's an internal OF API that > shouldn't be used by drivers. Platform drivers should use > platform device APIs instead. Therefore, add a platform_irq_count() > API that mirrors the of_irq_count() API so that platform drivers > can stay DT agnostic. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/3] driver-core: platform: Add platform_irq_count() @ 2016-01-07 1:15 ` Rob Herring 0 siblings, 0 replies; 32+ messages in thread From: Rob Herring @ 2016-01-07 1:15 UTC (permalink / raw) To: Stephen Boyd Cc: Linus Walleij, linux-kernel, linux-arm-msm, linux-arm-kernel, Greg Kroah-Hartman, Andy Gross On Wed, Jan 6, 2016 at 7:12 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: > A recent patch added calls to of_irq_count() in the qcom pinctrl > drivers and that caused module build failures because > of_irq_count() is not an exported symbol. We shouldn't export > of_irq_count() to modules because it's an internal OF API that > shouldn't be used by drivers. Platform drivers should use > platform device APIs instead. Therefore, add a platform_irq_count() > API that mirrors the of_irq_count() API so that platform drivers > can stay DT agnostic. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Rob Herring <robh@kernel.org> ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/3] driver-core: platform: Add platform_irq_count() 2016-01-07 1:12 ` Stephen Boyd @ 2016-01-07 1:47 ` Greg Kroah-Hartman -1 siblings, 0 replies; 32+ messages in thread From: Greg Kroah-Hartman @ 2016-01-07 1:47 UTC (permalink / raw) To: Stephen Boyd Cc: Linus Walleij, linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross On Wed, Jan 06, 2016 at 05:12:47PM -0800, Stephen Boyd wrote: > A recent patch added calls to of_irq_count() in the qcom pinctrl > drivers and that caused module build failures because > of_irq_count() is not an exported symbol. We shouldn't export > of_irq_count() to modules because it's an internal OF API that > shouldn't be used by drivers. Platform drivers should use > platform device APIs instead. Therefore, add a platform_irq_count() > API that mirrors the of_irq_count() API so that platform drivers > can stay DT agnostic. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> > --- > drivers/base/platform.c | 20 ++++++++++++++++++++ > include/linux/platform_device.h | 1 + > 2 files changed, 21 insertions(+) Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 1/3] driver-core: platform: Add platform_irq_count() @ 2016-01-07 1:47 ` Greg Kroah-Hartman 0 siblings, 0 replies; 32+ messages in thread From: Greg Kroah-Hartman @ 2016-01-07 1:47 UTC (permalink / raw) To: linux-arm-kernel On Wed, Jan 06, 2016 at 05:12:47PM -0800, Stephen Boyd wrote: > A recent patch added calls to of_irq_count() in the qcom pinctrl > drivers and that caused module build failures because > of_irq_count() is not an exported symbol. We shouldn't export > of_irq_count() to modules because it's an internal OF API that > shouldn't be used by drivers. Platform drivers should use > platform device APIs instead. Therefore, add a platform_irq_count() > API that mirrors the of_irq_count() API so that platform drivers > can stay DT agnostic. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> > --- > drivers/base/platform.c | 20 ++++++++++++++++++++ > include/linux/platform_device.h | 1 + > 2 files changed, 21 insertions(+) Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/3] driver-core: platform: Add platform_irq_count() 2016-01-07 1:12 ` Stephen Boyd (?) @ 2016-01-07 9:34 ` Linus Walleij -1 siblings, 0 replies; 32+ messages in thread From: Linus Walleij @ 2016-01-07 9:34 UTC (permalink / raw) To: Stephen Boyd Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Greg Kroah-Hartman, Andy Gross On Thu, Jan 7, 2016 at 2:12 AM, Stephen Boyd <sboyd@codeaurora.org> wrote: > A recent patch added calls to of_irq_count() in the qcom pinctrl > drivers and that caused module build failures because > of_irq_count() is not an exported symbol. We shouldn't export > of_irq_count() to modules because it's an internal OF API that > shouldn't be used by drivers. Platform drivers should use > platform device APIs instead. Therefore, add a platform_irq_count() > API that mirrors the of_irq_count() API so that platform drivers > can stay DT agnostic. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Patch applied with Rob's and Greg's ACKs. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 1/3] driver-core: platform: Add platform_irq_count() @ 2016-01-07 9:34 ` Linus Walleij 0 siblings, 0 replies; 32+ messages in thread From: Linus Walleij @ 2016-01-07 9:34 UTC (permalink / raw) To: linux-arm-kernel On Thu, Jan 7, 2016 at 2:12 AM, Stephen Boyd <sboyd@codeaurora.org> wrote: > A recent patch added calls to of_irq_count() in the qcom pinctrl > drivers and that caused module build failures because > of_irq_count() is not an exported symbol. We shouldn't export > of_irq_count() to modules because it's an internal OF API that > shouldn't be used by drivers. Platform drivers should use > platform device APIs instead. Therefore, add a platform_irq_count() > API that mirrors the of_irq_count() API so that platform drivers > can stay DT agnostic. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Patch applied with Rob's and Greg's ACKs. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/3] driver-core: platform: Add platform_irq_count() @ 2016-01-07 9:34 ` Linus Walleij 0 siblings, 0 replies; 32+ messages in thread From: Linus Walleij @ 2016-01-07 9:34 UTC (permalink / raw) To: Stephen Boyd Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Greg Kroah-Hartman, Andy Gross On Thu, Jan 7, 2016 at 2:12 AM, Stephen Boyd <sboyd@codeaurora.org> wrote: > A recent patch added calls to of_irq_count() in the qcom pinctrl > drivers and that caused module build failures because > of_irq_count() is not an exported symbol. We shouldn't export > of_irq_count() to modules because it's an internal OF API that > shouldn't be used by drivers. Platform drivers should use > platform device APIs instead. Therefore, add a platform_irq_count() > API that mirrors the of_irq_count() API so that platform drivers > can stay DT agnostic. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Patch applied with Rob's and Greg's ACKs. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 1/3] driver-core: platform: Add platform_irq_count() 2016-01-07 1:12 ` Stephen Boyd @ 2016-01-07 10:32 ` Arnd Bergmann -1 siblings, 0 replies; 32+ messages in thread From: Arnd Bergmann @ 2016-01-07 10:32 UTC (permalink / raw) To: linux-arm-kernel Cc: Stephen Boyd, Linus Walleij, linux-arm-msm, linux-kernel, Rob Herring, Greg Kroah-Hartman, Andy Gross On Wednesday 06 January 2016 17:12:47 Stephen Boyd wrote: > A recent patch added calls to of_irq_count() in the qcom pinctrl > drivers and that caused module build failures because > of_irq_count() is not an exported symbol. We shouldn't export > of_irq_count() to modules because it's an internal OF API that > shouldn't be used by drivers. Platform drivers should use > platform device APIs instead. Therefore, add a platform_irq_count() > API that mirrors the of_irq_count() API so that platform drivers > can stay DT agnostic. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> > Acked-by: Arnd Bergmann <arnd@arndb.de> I think there are a couple of other drivers that can use this too. Arnd ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 1/3] driver-core: platform: Add platform_irq_count() @ 2016-01-07 10:32 ` Arnd Bergmann 0 siblings, 0 replies; 32+ messages in thread From: Arnd Bergmann @ 2016-01-07 10:32 UTC (permalink / raw) To: linux-arm-kernel On Wednesday 06 January 2016 17:12:47 Stephen Boyd wrote: > A recent patch added calls to of_irq_count() in the qcom pinctrl > drivers and that caused module build failures because > of_irq_count() is not an exported symbol. We shouldn't export > of_irq_count() to modules because it's an internal OF API that > shouldn't be used by drivers. Platform drivers should use > platform device APIs instead. Therefore, add a platform_irq_count() > API that mirrors the of_irq_count() API so that platform drivers > can stay DT agnostic. > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> > Acked-by: Arnd Bergmann <arnd@arndb.de> I think there are a couple of other drivers that can use this too. Arnd ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() 2016-01-07 1:12 ` Stephen Boyd @ 2016-01-07 1:12 ` Stephen Boyd -1 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:12 UTC (permalink / raw) To: Linus Walleij Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross 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> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> --- drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 4 +++- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 4 +++- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 9 ++++++--- drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 9 ++++++--- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c index 60b922274879..9ed2b4eba1f8 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c @@ -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)); diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c index 5654287c382c..3fd04a6888a4 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c @@ -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)); diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c index df054e716dc0..bde2aa684dc1 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) { diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index 3ddb4cc38f1c..37ae6b72ea35 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c @@ -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 = of_irq_count(pdev->dev.of_node); + if (!npins) return -EINVAL; + if (npins < 0) + return npins; + pctrl->npins = npins; pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL); if (!pctrl->regmap) { -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() @ 2016-01-07 1:12 ` Stephen Boyd 0 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:12 UTC (permalink / raw) To: linux-arm-kernel 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> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> --- drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 4 +++- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 4 +++- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 9 ++++++--- drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 9 ++++++--- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c index 60b922274879..9ed2b4eba1f8 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c @@ -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)); diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c index 5654287c382c..3fd04a6888a4 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c @@ -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)); diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c index df054e716dc0..bde2aa684dc1 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) { diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index 3ddb4cc38f1c..37ae6b72ea35 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c @@ -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 = of_irq_count(pdev->dev.of_node); + if (!npins) return -EINVAL; + if (npins < 0) + return npins; + pctrl->npins = npins; pctrl->regmap = dev_get_regmap(pdev->dev.parent, NULL); if (!pctrl->regmap) { -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() 2016-01-07 1:12 ` Stephen Boyd (?) @ 2016-01-07 1:19 ` Bjorn Andersson -1 siblings, 0 replies; 32+ messages in thread From: Bjorn Andersson @ 2016-01-07 1:19 UTC (permalink / raw) To: Stephen Boyd Cc: Linus Walleij, linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross On Wed, Jan 6, 2016 at 5:12 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: > 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. > [..] > diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c > index 3ddb4cc38f1c..37ae6b72ea35 100644 > --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c > +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c > @@ -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 = of_irq_count(pdev->dev.of_node); 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) { Regards, Bjorn ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() @ 2016-01-07 1:19 ` Bjorn Andersson 0 siblings, 0 replies; 32+ messages in thread From: Bjorn Andersson @ 2016-01-07 1:19 UTC (permalink / raw) To: linux-arm-kernel On Wed, Jan 6, 2016 at 5:12 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: > 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. > [..] > diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c > index 3ddb4cc38f1c..37ae6b72ea35 100644 > --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c > +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c > @@ -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 = of_irq_count(pdev->dev.of_node); 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) { Regards, Bjorn ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() @ 2016-01-07 1:19 ` Bjorn Andersson 0 siblings, 0 replies; 32+ messages in thread From: Bjorn Andersson @ 2016-01-07 1:19 UTC (permalink / raw) To: Stephen Boyd Cc: Linus Walleij, linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross On Wed, Jan 6, 2016 at 5:12 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: > 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. > [..] > diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c > index 3ddb4cc38f1c..37ae6b72ea35 100644 > --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c > +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c > @@ -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 = of_irq_count(pdev->dev.of_node); 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) { Regards, Bjorn ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() 2016-01-07 1:19 ` Bjorn Andersson (?) @ 2016-01-07 1:28 ` Stephen Boyd -1 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:28 UTC (permalink / raw) To: Bjorn Andersson Cc: Linus Walleij, linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross On 01/06/16 17:19, Bjorn Andersson wrote: > On Wed, Jan 6, 2016 at 5:12 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: >> 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. >> > [..] >> diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c >> index 3ddb4cc38f1c..37ae6b72ea35 100644 >> --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c >> +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c >> @@ -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 = of_irq_count(pdev->dev.of_node); > platform_irq_count(pdev) Ouch. So many duplicates the odds were against me. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() @ 2016-01-07 1:28 ` Stephen Boyd 0 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:28 UTC (permalink / raw) To: linux-arm-kernel On 01/06/16 17:19, Bjorn Andersson wrote: > On Wed, Jan 6, 2016 at 5:12 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: >> 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. >> > [..] >> diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c >> index 3ddb4cc38f1c..37ae6b72ea35 100644 >> --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c >> +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c >> @@ -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 = of_irq_count(pdev->dev.of_node); > platform_irq_count(pdev) Ouch. So many duplicates the odds were against me. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() @ 2016-01-07 1:28 ` Stephen Boyd 0 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:28 UTC (permalink / raw) To: Bjorn Andersson Cc: Linus Walleij, linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross On 01/06/16 17:19, Bjorn Andersson wrote: > On Wed, Jan 6, 2016 at 5:12 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: >> 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. >> > [..] >> diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c >> index 3ddb4cc38f1c..37ae6b72ea35 100644 >> --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c >> +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c >> @@ -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 = of_irq_count(pdev->dev.of_node); > platform_irq_count(pdev) Ouch. So many duplicates the odds were against me. -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() 2016-01-07 1:19 ` Bjorn Andersson @ 2016-01-07 1:37 ` Stephen Boyd -1 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:37 UTC (permalink / raw) To: Linus Walleij Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross, Bjorn Andersson 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> --- Changes from v1: * Fixed one wrong of_irq_count() noticed by Bjorn drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 4 +++- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 4 +++- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 9 ++++++--- drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 9 ++++++--- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c index f46dbbf7ff25..4e12ded3c773 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c @@ -697,9 +697,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)); diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c index 5c7935012e3a..2f18323571a6 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c @@ -799,9 +799,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)); diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c index f75e482073b7..cd8580d9741d 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) { diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index 3e19c12a315a..54a5402a9079 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c @@ -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) { -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH v2 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() @ 2016-01-07 1:37 ` Stephen Boyd 0 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:37 UTC (permalink / raw) To: linux-arm-kernel 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> --- Changes from v1: * Fixed one wrong of_irq_count() noticed by Bjorn drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 4 +++- drivers/pinctrl/qcom/pinctrl-spmi-mpp.c | 4 +++- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 9 ++++++--- drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | 9 ++++++--- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c index f46dbbf7ff25..4e12ded3c773 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c @@ -697,9 +697,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)); diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c index 5c7935012e3a..2f18323571a6 100644 --- a/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-spmi-mpp.c @@ -799,9 +799,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)); diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c index f75e482073b7..cd8580d9741d 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) { diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index 3e19c12a315a..54a5402a9079 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c @@ -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) { -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH v2 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() 2016-01-07 1:37 ` Stephen Boyd (?) @ 2016-01-07 9:36 ` Linus Walleij -1 siblings, 0 replies; 32+ messages in thread From: Linus Walleij @ 2016-01-07 9:36 UTC (permalink / raw) To: Stephen Boyd Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross, Bjorn Andersson On Thu, Jan 7, 2016 at 2:37 AM, Stephen Boyd <sboyd@codeaurora.org> wrote: > 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> > --- > > Changes from v1: > * Fixed one wrong of_irq_count() noticed by Bjorn This v2 patch applied. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH v2 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() @ 2016-01-07 9:36 ` Linus Walleij 0 siblings, 0 replies; 32+ messages in thread From: Linus Walleij @ 2016-01-07 9:36 UTC (permalink / raw) To: linux-arm-kernel On Thu, Jan 7, 2016 at 2:37 AM, Stephen Boyd <sboyd@codeaurora.org> wrote: > 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> > --- > > Changes from v1: > * Fixed one wrong of_irq_count() noticed by Bjorn This v2 patch applied. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH v2 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() @ 2016-01-07 9:36 ` Linus Walleij 0 siblings, 0 replies; 32+ messages in thread From: Linus Walleij @ 2016-01-07 9:36 UTC (permalink / raw) To: Stephen Boyd Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross, Bjorn Andersson On Thu, Jan 7, 2016 at 2:37 AM, Stephen Boyd <sboyd@codeaurora.org> wrote: > 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> > --- > > Changes from v1: > * Fixed one wrong of_irq_count() noticed by Bjorn This v2 patch applied. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 3/3] Revert "pinctrl: qcom: make PMIC drivers bool" 2016-01-07 1:12 ` Stephen Boyd @ 2016-01-07 1:12 ` Stephen Boyd -1 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:12 UTC (permalink / raw) To: Linus Walleij Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross This reverts commit bda7c4c2b9767ce2af4394754498662d62079af5. These drivers build as modules now that we use platform_irq_count() instead of of_irq_count(). Cc: Rob Herring <robh+dt@kernel.org> Cc: Andy Gross <andy.gross@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> --- drivers/pinctrl/qcom/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/qcom/Kconfig b/drivers/pinctrl/qcom/Kconfig index c658d9bce285..eeac8cba8a21 100644 --- a/drivers/pinctrl/qcom/Kconfig +++ b/drivers/pinctrl/qcom/Kconfig @@ -80,7 +80,7 @@ config PINCTRL_QDF2XXX Qualcomm Technologies QDF2xxx SOCs. config PINCTRL_QCOM_SPMI_PMIC - bool "Qualcomm SPMI PMIC pin controller driver" + tristate "Qualcomm SPMI PMIC pin controller driver" depends on GPIOLIB && OF && SPMI select REGMAP_SPMI select PINMUX @@ -93,7 +93,7 @@ config PINCTRL_QCOM_SPMI_PMIC devices are pm8841, pm8941 and pma8084. config PINCTRL_QCOM_SSBI_PMIC - bool "Qualcomm SSBI PMIC pin controller driver" + tristate "Qualcomm SSBI PMIC pin controller driver" depends on GPIOLIB && OF select PINMUX select PINCONF -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply related [flat|nested] 32+ messages in thread
* [PATCH 3/3] Revert "pinctrl: qcom: make PMIC drivers bool" @ 2016-01-07 1:12 ` Stephen Boyd 0 siblings, 0 replies; 32+ messages in thread From: Stephen Boyd @ 2016-01-07 1:12 UTC (permalink / raw) To: linux-arm-kernel This reverts commit bda7c4c2b9767ce2af4394754498662d62079af5. These drivers build as modules now that we use platform_irq_count() instead of of_irq_count(). Cc: Rob Herring <robh+dt@kernel.org> Cc: Andy Gross <andy.gross@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> --- drivers/pinctrl/qcom/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/qcom/Kconfig b/drivers/pinctrl/qcom/Kconfig index c658d9bce285..eeac8cba8a21 100644 --- a/drivers/pinctrl/qcom/Kconfig +++ b/drivers/pinctrl/qcom/Kconfig @@ -80,7 +80,7 @@ config PINCTRL_QDF2XXX Qualcomm Technologies QDF2xxx SOCs. config PINCTRL_QCOM_SPMI_PMIC - bool "Qualcomm SPMI PMIC pin controller driver" + tristate "Qualcomm SPMI PMIC pin controller driver" depends on GPIOLIB && OF && SPMI select REGMAP_SPMI select PINMUX @@ -93,7 +93,7 @@ config PINCTRL_QCOM_SPMI_PMIC devices are pm8841, pm8941 and pma8084. config PINCTRL_QCOM_SSBI_PMIC - bool "Qualcomm SSBI PMIC pin controller driver" + tristate "Qualcomm SSBI PMIC pin controller driver" depends on GPIOLIB && OF select PINMUX select PINCONF -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project ^ permalink raw reply related [flat|nested] 32+ messages in thread
* Re: [PATCH 3/3] Revert "pinctrl: qcom: make PMIC drivers bool" 2016-01-07 1:12 ` Stephen Boyd (?) @ 2016-01-07 9:37 ` Linus Walleij -1 siblings, 0 replies; 32+ messages in thread From: Linus Walleij @ 2016-01-07 9:37 UTC (permalink / raw) To: Stephen Boyd Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross On Thu, Jan 7, 2016 at 2:12 AM, Stephen Boyd <sboyd@codeaurora.org> wrote: > This reverts commit bda7c4c2b9767ce2af4394754498662d62079af5. > These drivers build as modules now that we use > platform_irq_count() instead of of_irq_count(). > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Patch applied. Thanks for digging in and fixing this, excellent work as always. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 32+ messages in thread
* [PATCH 3/3] Revert "pinctrl: qcom: make PMIC drivers bool" @ 2016-01-07 9:37 ` Linus Walleij 0 siblings, 0 replies; 32+ messages in thread From: Linus Walleij @ 2016-01-07 9:37 UTC (permalink / raw) To: linux-arm-kernel On Thu, Jan 7, 2016 at 2:12 AM, Stephen Boyd <sboyd@codeaurora.org> wrote: > This reverts commit bda7c4c2b9767ce2af4394754498662d62079af5. > These drivers build as modules now that we use > platform_irq_count() instead of of_irq_count(). > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Patch applied. Thanks for digging in and fixing this, excellent work as always. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 32+ messages in thread
* Re: [PATCH 3/3] Revert "pinctrl: qcom: make PMIC drivers bool" @ 2016-01-07 9:37 ` Linus Walleij 0 siblings, 0 replies; 32+ messages in thread From: Linus Walleij @ 2016-01-07 9:37 UTC (permalink / raw) To: Stephen Boyd Cc: linux-kernel, linux-arm-msm, linux-arm-kernel, Rob Herring, Andy Gross On Thu, Jan 7, 2016 at 2:12 AM, Stephen Boyd <sboyd@codeaurora.org> wrote: > This reverts commit bda7c4c2b9767ce2af4394754498662d62079af5. > These drivers build as modules now that we use > platform_irq_count() instead of of_irq_count(). > > Cc: Rob Herring <robh+dt@kernel.org> > Cc: Andy Gross <andy.gross@linaro.org> > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Patch applied. Thanks for digging in and fixing this, excellent work as always. Yours, Linus Walleij ^ permalink raw reply [flat|nested] 32+ messages in thread
end of thread, other threads:[~2016-01-07 10:33 UTC | newest] Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-01-07 1:12 [PATCH 0/3] Make qcom pinctrl drivers tristate again Stephen Boyd 2016-01-07 1:12 ` Stephen Boyd 2016-01-07 1:12 ` [PATCH 1/3] driver-core: platform: Add platform_irq_count() Stephen Boyd 2016-01-07 1:12 ` Stephen Boyd 2016-01-07 1:15 ` Rob Herring 2016-01-07 1:15 ` Rob Herring 2016-01-07 1:15 ` Rob Herring 2016-01-07 1:47 ` Greg Kroah-Hartman 2016-01-07 1:47 ` Greg Kroah-Hartman 2016-01-07 9:34 ` Linus Walleij 2016-01-07 9:34 ` Linus Walleij 2016-01-07 9:34 ` Linus Walleij 2016-01-07 10:32 ` Arnd Bergmann 2016-01-07 10:32 ` Arnd Bergmann 2016-01-07 1:12 ` [PATCH 2/3] pinctrl: qcom: Use platform_irq_count() instead of of_irq_count() Stephen Boyd 2016-01-07 1:12 ` Stephen Boyd 2016-01-07 1:19 ` Bjorn Andersson 2016-01-07 1:19 ` Bjorn Andersson 2016-01-07 1:19 ` Bjorn Andersson 2016-01-07 1:28 ` Stephen Boyd 2016-01-07 1:28 ` Stephen Boyd 2016-01-07 1:28 ` Stephen Boyd 2016-01-07 1:37 ` [PATCH v2 " Stephen Boyd 2016-01-07 1:37 ` Stephen Boyd 2016-01-07 9:36 ` Linus Walleij 2016-01-07 9:36 ` Linus Walleij 2016-01-07 9:36 ` Linus Walleij 2016-01-07 1:12 ` [PATCH 3/3] Revert "pinctrl: qcom: make PMIC drivers bool" Stephen Boyd 2016-01-07 1:12 ` Stephen Boyd 2016-01-07 9:37 ` Linus Walleij 2016-01-07 9:37 ` Linus Walleij 2016-01-07 9:37 ` Linus Walleij
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.