Skip to content

Commit e49f18b

Browse files
tititiou36Vudentz
authored andcommitted
Bluetooth: btbcm: Use strreplace()
Use strreplace() 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 881559a commit e49f18b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/bluetooth/btbcm.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/firmware.h>
1212
#include <linux/dmi.h>
1313
#include <linux/of.h>
14+
#include <linux/string.h>
1415
#include <asm/unaligned.h>
1516

1617
#include <net/bluetooth/bluetooth.h>
@@ -544,7 +545,6 @@ static const char *btbcm_get_board_name(struct device *dev)
544545
char *board_type;
545546
const char *tmp;
546547
int len;
547-
int i;
548548

549549
root = of_find_node_by_path("/");
550550
if (!root)
@@ -557,10 +557,7 @@ static const char *btbcm_get_board_name(struct device *dev)
557557
len = strlen(tmp) + 1;
558558
board_type = devm_kzalloc(dev, len, GFP_KERNEL);
559559
strscpy(board_type, tmp, len);
560-
for (i = 0; i < len; i++) {
561-
if (board_type[i] == '/')
562-
board_type[i] = '-';
563-
}
560+
strreplace(board_type, '/', '-');
564561
of_node_put(root);
565562

566563
return board_type;

0 commit comments

Comments
 (0)