Skip to content

Commit

Permalink
Bluetooth: btbcm: Use strreplace()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christophe JAILLET authored and Luiz Augusto von Dentz committed Mar 6, 2024
1 parent 881559a commit e49f18b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/bluetooth/btbcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <linux/firmware.h>
#include <linux/dmi.h>
#include <linux/of.h>
#include <linux/string.h>
#include <asm/unaligned.h>

#include <net/bluetooth/bluetooth.h>
Expand Down Expand Up @@ -544,7 +545,6 @@ static const char *btbcm_get_board_name(struct device *dev)
char *board_type;
const char *tmp;
int len;
int i;

root = of_find_node_by_path("/");
if (!root)
Expand All @@ -557,10 +557,7 @@ static const char *btbcm_get_board_name(struct device *dev)
len = strlen(tmp) + 1;
board_type = devm_kzalloc(dev, len, GFP_KERNEL);
strscpy(board_type, tmp, len);
for (i = 0; i < len; i++) {
if (board_type[i] == '/')
board_type[i] = '-';
}
strreplace(board_type, '/', '-');
of_node_put(root);

return board_type;
Expand Down

0 comments on commit e49f18b

Please sign in to comment.