]> git.baikalelectronics.ru Git - kernel.git/commit
mfd: Fix 88pm860x uninitialized variable and clean up
authorDan Carpenter <error27@gmail.com>
Wed, 26 May 2010 22:54:09 +0000 (00:54 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 12 Aug 2010 09:27:18 +0000 (11:27 +0200)
commit4bcd261f4468014144ae6f3c3e909b7ea5e6b692
tree4763ef7bf41e50e3d443fefc3a58faa3ee0df31a
parentfd79df0ef06d0bebcb9a85b8db6dfa0e2238544e
mfd: Fix 88pm860x uninitialized variable and clean up

The original code had a compile warning:
drivers/mfd/88pm860x-core.c:431: warning: ‘ret’ may be used
uninitialized in this function
It seems like the warning is valid if either pdata or pdata->touch is
NULL.

This patch checks pdata and pdata->touch at the beginning of the
function.  That means everything can be pulled in one indent level.
Now all the statements fit within the 80 character limit.

Also at that point the "use_gpadc" variable isn't needed and removing
it simplifies the logic.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Haojian Zhuang <hzhuang1@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/88pm860x-core.c