i2c: stm32f7: fix & reorder remove & probe error handling
authorAlain Volmat <alain.volmat@st.com>
Fri, 25 Oct 2019 14:04:24 +0000 (16:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 18:17:27 +0000 (19:17 +0100)
commit1558fadfca30c82751cda70315c768ebabaaf260
tree6453354dc5847c7faefc374e50570c2cf9d670c1
parent6b1400f260df61fd6921a098fc00f7b647421b40
i2c: stm32f7: fix & reorder remove & probe error handling

[ Upstream commit 53aaaa5d9b1e95eb40e877fbffa6f964a8394bb7 ]

Add missing dma channels free calls in case of error during probe
and reorder the remove function so that dma channels are freed after
the i2c adapter is deleted.
Overall, reorder the remove function so that probe error handling order
and remove function order are same.

Fixes: 7ecc8cfde553 ("i2c: i2c-stm32f7: Add DMA support")
Signed-off-by: Alain Volmat <alain.volmat@st.com>
Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-stm32f7.c