]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: hci_bcm: Simplify clk_get error handling
authorChen-Yu Tsai <wens@csie.org>
Mon, 17 Dec 2018 04:04:40 +0000 (12:04 +0800)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 18 Dec 2018 23:28:38 +0000 (00:28 +0100)
commita714c72b8ee0744d89a706df62d3aa8240b3f54c
treeeaec0047012f2b001e05840eda702e5dc91e1c50
parent62b99ac5b3c2d403025b627bbd8e3f4d32cfff8a
Bluetooth: hci_bcm: Simplify clk_get error handling

The driver currently checks the clk pointer for an error condition, as
returned by clk_get, before every invocation of the clk consumer API.
This is redundant if the goal is simply to ignore the errors, thereby
making the clk optional. The clk consumer API already checks if the
pointer is NULL or not.

Simplify the code a bit by assigning NULL to the clk pointer if the
error condition is one we want to ignore, which is every error except
deferred probing.

Tested-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/hci_bcm.c