linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl or i2c-s3c2410: fix pinctrl NULL return values in stubs
@ 2013-02-23 17:55 Heiko Stübner
       [not found] ` <201302231855.47560.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
  0 siblings, 1 reply; 16+ messages in thread
From: Heiko Stübner @ 2013-02-23 17:55 UTC (permalink / raw)
  To: Linus Walleij, Wolfram Sang
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kukjin Kim,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA, Tomasz Figa

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 pinctrl_get only returns NULL but the i2c driver only checked
for real error-pointers. This resulted in the i2c gpios not getting
configured at all.

There are of course two possible solutions. Check for NULL pinctrl
handles in the driver or return meaningful error codes in the pinctrl
stubs. All other pinctrl drivers also only seem to handle real error
codes and would gladly accept NULL handles, so I'm not sure which is
the correct fix to not break to much existing code.

Therefore I implemented both variants and you get to pick :-) .
This of course means from the following patches only one is necessary.


Heiko

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2013-02-25  0:02 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-23 17:55 [PATCH] pinctrl or i2c-s3c2410: fix pinctrl NULL return values in stubs Heiko Stübner
     [not found] ` <201302231855.47560.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2013-02-23 17:56   ` [PATCH] pinctrl: return real error codes when pinctrl is not included Heiko Stübner
     [not found]     ` <201302231856.35083.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2013-02-24  0:40       ` Linus Walleij
2013-02-24 22:34         ` Heiko Stübner
2013-02-24 22:42           ` Linus Walleij
     [not found]             ` <CACRpkdbKFWcT_Oa00nd_Op5ndOEc-cEkZm6fzHRuxs0Rc+ZOeA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-24 23:15               ` Heiko Stübner
2013-02-23 17:57   ` [PATCH] i2c: s3c2410: check for NULL pinctrl handle Heiko Stübner
     [not found]     ` <201302231857.46445.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2013-02-24  0:16       ` Linus Walleij
2013-02-24  0:38         ` Tomasz Figa
2013-02-24  0:47           ` Linus Walleij
     [not found]             ` <CACRpkdaFv=V8M_Ztb5-hrYm6YnXiG6fg6Z13y3NVFdszBk=7ZQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-24  0:58               ` Tomasz Figa
2013-02-24  1:01                 ` Linus Walleij
     [not found]                   ` <CACRpkdYBjZgEo6qEyBOcYuPzpQUAZ9x-kvFabz0y0pEQs35sKw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-24 17:00                     ` Tomasz Figa
2013-02-24 22:39                       ` Linus Walleij
2013-02-24 23:16                         ` Heiko Stübner
     [not found]                           ` <201302250016.49773.heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>
2013-02-25  0:02                             ` Tomasz Figa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).