mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									e49f18b92b
								
							
						
					
					
						commit
						f9183eaad9
					
				
					 1 changed files with 1 additions and 4 deletions
				
			
		| 
						 | 
					@ -544,7 +544,6 @@ static const char *btbcm_get_board_name(struct device *dev)
 | 
				
			||||||
	struct device_node *root;
 | 
						struct device_node *root;
 | 
				
			||||||
	char *board_type;
 | 
						char *board_type;
 | 
				
			||||||
	const char *tmp;
 | 
						const char *tmp;
 | 
				
			||||||
	int len;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	root = of_find_node_by_path("/");
 | 
						root = of_find_node_by_path("/");
 | 
				
			||||||
	if (!root)
 | 
						if (!root)
 | 
				
			||||||
| 
						 | 
					@ -554,9 +553,7 @@ static const char *btbcm_get_board_name(struct device *dev)
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* get rid of any '/' in the compatible string */
 | 
						/* get rid of any '/' in the compatible string */
 | 
				
			||||||
	len = strlen(tmp) + 1;
 | 
						board_type = devm_kstrdup(dev, tmp, GFP_KERNEL);
 | 
				
			||||||
	board_type = devm_kzalloc(dev, len, GFP_KERNEL);
 | 
					 | 
				
			||||||
	strscpy(board_type, tmp, len);
 | 
					 | 
				
			||||||
	strreplace(board_type, '/', '-');
 | 
						strreplace(board_type, '/', '-');
 | 
				
			||||||
	of_node_put(root);
 | 
						of_node_put(root);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue