usb: chipidea: Consolidate extcon notifiers
authorStephen Boyd <stephen.boyd@linaro.org>
Fri, 20 Jan 2017 07:11:55 +0000 (15:11 +0800)
committerPeter Chen <peter.chen@nxp.com>
Fri, 20 Jan 2017 07:13:49 +0000 (15:13 +0800)
commit5cc49268995a1f063a7a569299393e4cf9d06923
tree9293570fc495bcb5e9716e0c1b8e436dec048aac
parent7bb7e9b1a4319d7c305c033c2df46028fbcc10ae
usb: chipidea: Consolidate extcon notifiers

The two extcon notifiers are almost the same except for the
variable name for the cable structure and the id notifier inverts
the cable->state logic. Make it the same and replace two
functions with one to save some lines. This also makes it so that
the id cable state is true when the id pin is pulled low, so we
change the name of ->state to ->connected to properly reflect
that we're interested in the cable being connected.

Acked-by: Peter Chen <peter.chen@nxp.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Ivan T. Ivanov" <iivanov.xz@gmail.com>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/chipidea/core.c
drivers/usb/chipidea/otg.c
include/linux/usb/chipidea.h