OSDN Git Service

usb: dwc3: pci: make better use of gpiod API
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 12 Jun 2015 07:04:55 +0000 (09:04 +0200)
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 6 Jul 2015 08:10:23 +0000 (10:10 +0200)
commit75da3b1c24389fe78680269176de0332d35f7fad
treefa5a3645e2db73b3784bc7a9d307e5aca724c766
parent8e71c68074ff37348d586c87b0ee530e7440b094
usb: dwc3: pci: make better use of gpiod API

Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Use this additional parameter and the _optional variant to simplify the
driver and improve error handling. Also expand the comment to explain
why it's not sensible to switch to devm_gpiod_get and why the gpiod_put
is also necessary.

Furthermore this is one caller less that stops us making the flags
argument to gpiod_get*() mandatory.

Tested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
drivers/usb/dwc3/dwc3-pci.c