i2c: s3c2410: check for NULL pinctrl handle

A patch from »pinctrl or i2c-s3c2410: fix pinctrl NULL return values in stubs« in state Obsolete for linux-kernel

From: Heiko Stuebner <heiko@...> Date: Sat, 23 Feb 2013 18:22:07 +0100

Commit-Message

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 <heiko@...>

Patch-Comment

drivers/i2c/busses/i2c-s3c2410.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)

Statistics

  • 2 lines added
  • 1 lines removed

Changes

----------------------- drivers/i2c/busses/i2c-s3c2410.c -----------------------
index f6b880b..e58337f 100644
@@ -1060,7 +1060,8 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev)
if (i2c->pdata->cfg_gpio) {
i2c->pdata->cfg_gpio(to_platform_device(i2c->dev));
- } else if (IS_ERR(i2c->pctrl) && s3c24xx_i2c_parse_dt_gpio(i2c)) {
+ } else if ((!i2c->pctrl || IS_ERR(i2c->pctrl)) &&
+ s3c24xx_i2c_parse_dt_gpio(i2c)) {
return -EINVAL;
}
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...