extcon: Remove potential problem when calling extcon_register_notifier()
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 19 Dec 2016 12:02:33 +0000 (21:02 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Nov 2017 08:23:21 +0000 (09:23 +0100)
commitc4a77534ce2bbc5cb0b6d8b16a10dbe9157c58e1
tree2b0ddc6d58b69268464a82ca7244df120c5a5242
parentee61d06653fda94176813c852a547567a7887d21
extcon: Remove potential problem when calling extcon_register_notifier()

[ Upstream commit 01b4c9a1ae07a25d208cad0da7dd288007a22984 ]

This patch removes the potential problem of extcon_register_notifier()
when edev parameter is NULL. When edev is NULL, this function returns
the first extcon device which includes the sepecific external connector
of second paramter. But, it don't guarantee the same operation in all cases.
To remove this confusion and potential problem, this patch fixes it.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/extcon/extcon.c