Skip to contentSkip to conversation

Bluetooth:hci_bcm:Check return value from devm_clk_get

PATCH In review RAGHU Halharvi 2 participants 2 messages Jul 17, 2018 – Jul 18, 2018 1 message not in the archive Bluetooth drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 Bluetooth:hci_bcm:Check return value from devm_clk_get

* Check return value from devm_clk_get & return appropriate error.

---
 drivers/bluetooth/hci_bcm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/bluetooth/hci_bcm.c +2 -0
index 441f5e1deb11..1295cc89d702 100644
@@ -910,6 +910,8 @@ static int bcm_get_resources(struct bcm_device *dev)
 		return 0;
 
 	dev->clk = devm_clk_get(dev->dev, NULL);
+	if (IS_ERR(dev->clk))
+		return PTR_ERR(dev->clk);
 
 	dev->device_wakeup = devm_gpiod_get_optional(dev->dev, "device-wakeup",
 						     GPIOD_OUT_LOW);
Signature · 1 line
2.17.1
maintainer
#2 lore raw

Hi Raghu,

Quoted 10 lines

* Check return value from devm_clk_get & return appropriate error.
---
drivers/bluetooth/hci_bcm.c | 2 ++

1 file changed, 2 insertions(+)
drivers/bluetooth/hci_bcm.c +0 -0
index 441f5e1deb11..1295cc89d702 100644

drivers/bluetooth/hci_bcm.c static int bcm_get_resources(struct bcm_device *dev) · line 914

Quoted 5 lines
drivers/bluetooth/hci_bcm.c +2 -0
@@ -910,6 +910,8 @@ static int bcm_get_resources(struct bcm_device *dev)
 		return 0;
 
 	dev->clk = devm_clk_get(dev->dev, NULL);
+	if (IS_ERR(dev->clk))
+		return PTR_ERR(dev->clk);

so I assumed this was not done on purpose and allow for dev->clk = NULL since all other clock handling functions will cope with it. Can someone NAK or ACK this patch?

Regards

Marcel