regulator: cleanup regulator_ena_gpio_free()
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Wed, 12 Aug 2020 01:31:37 +0000 (03:31 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 17 Aug 2020 12:13:54 +0000 (13:13 +0100)
commit2dbf085594370abc1453356518719300d8a7acc1
treeb2c84d9898cd4fe08fd1606ca6f1c1013a10fd8e
parentd3c731564e09b6c2ebefcd1344743a91a237d6dc
regulator: cleanup regulator_ena_gpio_free()

Since only regulator_ena_gpio_request() allocates rdev->ena_pin, and it
guarantees that same gpiod gets same pin structure, it is enough to
compare just the pointers. Also we know there can be only one matching
entry on the list. Rework the code take advantage of the facts.

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Link: https://lore.kernel.org/r/3ff002c7aa3bd774491af4291a9df23541fcf892.1597195321.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c