Search Linux Wireless

[PATCH v1] wifi: cfg80211: simplify the code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Simplifying the code makes it more readable:
1.Use dev_name instead of pdev->driver->name.
2.There is no need to call wiphy_dev again.

Signed-off-by: Zheng tan <tanzheng@xxxxxxxxxx>
---
 net/wireless/ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/wireless/ethtool.c b/net/wireless/ethtool.c
index 2613d6ac0fda..0acfdc44b479 100644
--- a/net/wireless/ethtool.c
+++ b/net/wireless/ethtool.c
@@ -10,7 +10,7 @@ void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 	struct device *pdev = wiphy_dev(wdev->wiphy);
 
 	if (pdev->driver)
-		strscpy(info->driver, pdev->driver->name,
+		strscpy(info->driver, dev_name(pdev),
 			sizeof(info->driver));
 	else
 		strscpy(info->driver, "N/A", sizeof(info->driver));
@@ -23,7 +23,7 @@ void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 	else
 		strscpy(info->fw_version, "N/A", sizeof(info->fw_version));
 
-	strscpy(info->bus_info, dev_name(wiphy_dev(wdev->wiphy)),
+	strscpy(info->bus_info, dev_name(pdev),
 		sizeof(info->bus_info));
 }
 EXPORT_SYMBOL(cfg80211_get_drvinfo);
-- 
2.25.1






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux