extcon: madera: Get micd_pol_gpio against extcon device not madera
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 11 Dec 2017 14:08:35 +0000 (14:08 +0000)
committer강신형 <s47.kang@samsung.com>
Tue, 19 Jun 2018 07:56:47 +0000 (16:56 +0900)
commit1bf5acbd78ed5c878dec2b4db0f360ecc4290904
tree992718768a02efe02a2bc2f9590511439cafe317
parentcc27cecb4ff093ac30674a5b1acf36556a5c4058
extcon: madera: Get micd_pol_gpio against extcon device not madera

If we devm get the micd_pol_gpio against the madera device it won't be
destroyed until after all the children of the MFD. Usually the
micd_pol_gpio will be supplied by the Madera GPIO driver, this means the
GPIO will normally only be freed after its driver has been removed.

Correct this issue by getting it against the extcon device such that the
GPIO is freed when the extcon device is destroyed, which should happen
before the GPIO device.

Change-Id: I35a3ee9eba7f9edf5c6aba47dd03f6e0ecbe9692
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
drivers/extcon/extcon-madera.c