[PATCH] pinctrl or i2c-s3c2410: fix pinctrl NULL return values in stubs

2013-02-23 Thread Heiko Stübner
Hi, while implementing devicetree support for the s3c2416 I noticed a fault in the i2c-s3c2410 driver. The s3c2416 does not support pinctrl at the moment (and will probably for a while), so the fallback functions in pinctrl/consumer.h were used. These functions fail silently and the relevant

[PATCH] pinctrl: return real error codes when pinctrl is not included

2013-02-23 Thread Heiko Stübner
Currently the fallback functions when pinctrl is not being built do return either NULL or 0, either no pinctrl handle or no error, making them fail silently. All drivers using pinctrl do only test for error conditions, which made for example the i2c-s3c2410 driver fail on a devicetree based

[PATCH] i2c: s3c2410: check for NULL pinctrl handle

2013-02-23 Thread Heiko Stübner
When pinctrl is not built the fallback functions fail silently and emit either 0 error codes or NULL pinctrl handles. Therefore it's needed to also check for this NULL-handle when falling back to parsing the i2c gpios from devicetree. Signed-off-by: Heiko Stuebner he...@sntech.de ---

Re: [PATCH] i2c: s3c2410: check for NULL pinctrl handle

2013-02-23 Thread Linus Walleij
On Sat, Feb 23, 2013 at 6:57 PM, Heiko Stübner he...@sntech.de wrote: When pinctrl is not built the fallback functions fail silently and emit either 0 error codes or NULL pinctrl handles. Therefore it's needed to also check for this NULL-handle when falling back to parsing the i2c gpios from

Re: [PATCH] i2c: s3c2410: check for NULL pinctrl handle

2013-02-23 Thread Tomasz Figa
Hi Linus, On Sunday 24 of February 2013 01:16:21 Linus Walleij wrote: On Sat, Feb 23, 2013 at 6:57 PM, Heiko Stübner he...@sntech.de wrote: When pinctrl is not built the fallback functions fail silently and emit either 0 error codes or NULL pinctrl handles. Therefore it's needed to also

Re: [PATCH] pinctrl: return real error codes when pinctrl is not included

2013-02-23 Thread Linus Walleij
On Sat, Feb 23, 2013 at 6:56 PM, Heiko Stübner he...@sntech.de wrote: Currently the fallback functions when pinctrl is not being built do return either NULL or 0, either no pinctrl handle or no error, making them fail silently. All drivers using pinctrl do only test for error conditions,

Re: [PATCH] i2c: s3c2410: check for NULL pinctrl handle

2013-02-23 Thread Linus Walleij
On Sun, Feb 24, 2013 at 1:38 AM, Tomasz Figa tomasz.f...@gmail.com wrote: The driver must know whether pin control is available, because it has to fall back to legacy GPIO-based pin configuration if it is not. This means that we must either check for NULL (which probably is not right, since

Re: [PATCH] i2c: s3c2410: check for NULL pinctrl handle

2013-02-23 Thread Tomasz Figa
On Sunday 24 of February 2013 01:47:49 Linus Walleij wrote: On Sun, Feb 24, 2013 at 1:38 AM, Tomasz Figa tomasz.f...@gmail.com wrote: The driver must know whether pin control is available, because it has to fall back to legacy GPIO-based pin configuration if it is not. This means that we

Re: [PATCH] i2c: s3c2410: check for NULL pinctrl handle

2013-02-23 Thread Linus Walleij
On Sun, Feb 24, 2013 at 1:58 AM, Tomasz Figa tomasz.f...@gmail.com wrote: [Me] Surely you know this when setting up the pdata from your machine? Cases 2) and 3) are both DT-enabled cases, where there is no pdata coming from board-specific code. (...) Note that we are talking here about a