Commit 21ac3dda authored by Vaibhav Gupta's avatar Vaibhav Gupta

software: kernel: hwmon: Remove unnecessary variable

Instead of having a static string, in char-array, which will be then put
into another string; we can directly put the value in devm_kasprintf()
Reported-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
Signed-off-by: 's avatarVaibhav Gupta <vaibhav.gupta@cern.ch>
parent 6ba837ca
......@@ -66,7 +66,6 @@ static const struct hwmon_chip_info ft_hwmon_temp_chip_info = {
int ft_hwmon_init(struct fmctdc_dev *ft)
{
char device_type[] = "Temperature - ";
struct device *dev = &ft->pdev->dev;
ft->hwmon_dev = devm_hwmon_device_register_with_info(dev,
......@@ -77,8 +76,7 @@ int ft_hwmon_init(struct fmctdc_dev *ft)
if(!IS_ERR(ft->hwmon_dev)) {
ft->hwmon_temp_sensor_id = devm_kasprintf(ft->hwmon_dev,
GFP_KERNEL,
"%s%s",
device_type,
"Temperature [%s]",
dev_name(&ft->slot->dev));
if(!ft->hwmon_temp_sensor_id) {
devm_hwmon_device_unregister(dev);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment