Skip to content

Commit f9183ea

Browse files
tititiou36Vudentz
authored andcommitted
Bluetooth: btbcm: Use devm_kstrdup()
Use devm_kstrdup() instead of hand-writing it. It is less verbose. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent e49f18b commit f9183ea

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/bluetooth/btbcm.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,6 @@ static const char *btbcm_get_board_name(struct device *dev)
544544
struct device_node *root;
545545
char *board_type;
546546
const char *tmp;
547-
int len;
548547

549548
root = of_find_node_by_path("/");
550549
if (!root)
@@ -554,9 +553,7 @@ static const char *btbcm_get_board_name(struct device *dev)
554553
return NULL;
555554

556555
/* get rid of any '/' in the compatible string */
557-
len = strlen(tmp) + 1;
558-
board_type = devm_kzalloc(dev, len, GFP_KERNEL);
559-
strscpy(board_type, tmp, len);
556+
board_type = devm_kstrdup(dev, tmp, GFP_KERNEL);
560557
strreplace(board_type, '/', '-');
561558
of_node_put(root);
562559

0 commit comments

Comments
 (0)