Re: [PATCH 1/3] pinctrl: rollback check for !dev-pins in pinctrl_pm_select*() APIs

2013-07-26 Thread Linus Walleij
On Wed, Jul 17, 2013 at 5:40 PM, Tony Lindgren t...@atomide.com wrote:
 * Grygorii Strashko grygorii.stras...@ti.com [130717 04:49]:
 The pinctrl support in Device core assumed to be optional - so, It's
 valid case, when there are no definition for default device's pinctrl
 states in DT at all (default, active, idle, sleep).
 And in this case dev-pins == NULL and pinctrl_pm_select*() API
 should return 0 always.

 Now the checks for !dev-pins have been removed from
 pinctrl_pm_select*() API mistakenly by the patch
 pinctrl: Remove duplicate code in pinctrl_pm_select_state functions
 http://www.spinics.net/lists/arm-kernel/msg258829.html

 Hence, rollback these checks in in pinctrl_pm_select*() APIs.

 Thanks, it's best that I fold this fix into my patch as it has not
 been committed yet.

I think I've applied the correct v2 version,
please check that linux-next is in good shape...

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] pinctrl: rollback check for !dev-pins in pinctrl_pm_select*() APIs

2013-07-17 Thread Grygorii Strashko
The pinctrl support in Device core assumed to be optional - so, It's
valid case, when there are no definition for default device's pinctrl
states in DT at all (default, active, idle, sleep).
And in this case dev-pins == NULL and pinctrl_pm_select*() API
should return 0 always.

Now the checks for !dev-pins have been removed from
pinctrl_pm_select*() API mistakenly by the patch
pinctrl: Remove duplicate code in pinctrl_pm_select_state functions
http://www.spinics.net/lists/arm-kernel/msg258829.html

Hence, rollback these checks in in pinctrl_pm_select*() APIs.

CC: Linus Walleij linus.wall...@linaro.org
Cc: Stephen Warren swar...@wwwdotorg.org
Signed-off-by: Grygorii Strashko grygorii.stras...@ti.com
---
Seems this one can be squashed in series
[PATCH 0/4] improved support for runtime muxing for pinctrl
http://www.spinics.net/lists/arm-kernel/msg258827.html

 drivers/pinctrl/core.c |   12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 4f58a97..ace4eb8 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -1390,6 +1390,9 @@ static int pinctrl_pm_select_state(struct device *dev, 
struct pinctrl_state *sta
  */
 int pinctrl_pm_select_default_state(struct device *dev)
 {
+   if (!dev-pins)
+   return 0;
+
return pinctrl_pm_select_state(dev, dev-pins-default_state);
 }
 EXPORT_SYMBOL_GPL(pinctrl_pm_select_default_state);
@@ -1400,6 +1403,9 @@ EXPORT_SYMBOL_GPL(pinctrl_pm_select_default_state);
  */
 int pinctrl_pm_select_active_state(struct device *dev)
 {
+   if (!dev-pins)
+   return 0;
+
return pinctrl_pm_select_state(dev, dev-pins-active_state);
 }
 EXPORT_SYMBOL_GPL(pinctrl_pm_select_active_state);
@@ -1410,6 +1416,9 @@ EXPORT_SYMBOL_GPL(pinctrl_pm_select_active_state);
  */
 int pinctrl_pm_select_sleep_state(struct device *dev)
 {
+   if (!dev-pins)
+   return 0;
+
return pinctrl_pm_select_state(dev, dev-pins-sleep_state);
 }
 EXPORT_SYMBOL_GPL(pinctrl_pm_select_sleep_state);
@@ -1420,6 +1429,9 @@ EXPORT_SYMBOL_GPL(pinctrl_pm_select_sleep_state);
  */
 int pinctrl_pm_select_idle_state(struct device *dev)
 {
+   if (!dev-pins)
+   return 0;
+
return pinctrl_pm_select_state(dev, dev-pins-idle_state);
 }
 EXPORT_SYMBOL_GPL(pinctrl_pm_select_idle_state);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] pinctrl: rollback check for !dev-pins in pinctrl_pm_select*() APIs

2013-07-17 Thread Tony Lindgren
* Grygorii Strashko grygorii.stras...@ti.com [130717 04:49]:
 The pinctrl support in Device core assumed to be optional - so, It's
 valid case, when there are no definition for default device's pinctrl
 states in DT at all (default, active, idle, sleep).
 And in this case dev-pins == NULL and pinctrl_pm_select*() API
 should return 0 always.
 
 Now the checks for !dev-pins have been removed from
 pinctrl_pm_select*() API mistakenly by the patch
 pinctrl: Remove duplicate code in pinctrl_pm_select_state functions
 http://www.spinics.net/lists/arm-kernel/msg258829.html
 
 Hence, rollback these checks in in pinctrl_pm_select*() APIs.

Thanks, it's best that I fold this fix into my patch as it has not
been committed yet.

Regards,

Tony
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html