pinctrl or i2c-s3c2410: fix pinctrl NULL return values in stubs
From: Heiko Stuebner <heiko@...> Date: Sat, 23 Feb 2013 18:22:07 +0100
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 ################# OBSOLETED ################# The first patch violates pinctrl opacity rules, as pinctrl should not disturb drivers, if it's not build. And the second patch misuses the null check to check for pinctrl availability, which is also a no-go.
Patches in this set
- [0001] pinctrl: return real error codes when pinctrl is not included (raw)
- [0002] i2c: s3c2410: check for NULL pinctrl handle (raw)
Statistics
- 2 individual patches
- 9 lines added
- 8 lines removed