soc: imx: gpcv2: fix regulator deferred probe
authorStefan Agner <stefan@agner.ch>
Wed, 2 Aug 2017 17:56:32 +0000 (10:56 -0700)
committerStefan Agner <stefan@agner.ch>
Mon, 7 Aug 2017 06:21:10 +0000 (23:21 -0700)
commit6128ead4a09150b29e4ee92756b54798b74b7e39
treeab43fb76cd41a746463b152b17460aa0d3c5a16b
parentaae4e7a8bc44722fe70d58920a36916b1043195e
soc: imx: gpcv2: fix regulator deferred probe

If a regulator requests a deferred probe, the power domain gets
initialized twice. This leads to a list double add (without
list debugging the kernel hangs due to the double add later):

  WARNING: CPU: 0 PID: 19 at lib/list_debug.c:31 __list_add_valid+0xbc/0xc4
  list_add double add: new=c1229754, prev=c12383b4, next=c1229754.

Initialize the power domain after we get the regulator, and do
not print an error in case the regulator deferrs probing.

Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Fixes: 03aa12629fc4 ("soc: imx: Add GPCv2 power gating driver")
Signed-off-by: Stefan Agner <stefan@agner.ch>
drivers/soc/imx/gpcv2.c