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)
commit8c08947b7c4f4496e7c23be970121280fcb6cbf5
treeeaec0047012f2b001e05840eda702e5dc91e1c50
parent28ac03b9ac3f784c2f048a910c8d0a7a87483b66
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