]> git.baikalelectronics.ru Git - kernel.git/commit
ixgbe: Convert to use devm_hwmon_device_register_with_groups
authorGuenter Roeck <linux@roeck-us.net>
Tue, 26 Nov 2013 07:15:28 +0000 (07:15 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 18 Dec 2013 06:43:05 +0000 (22:43 -0800)
commit5369521e481115cea2f7ea718a75037a6d3bfa75
treefe28c2b16a8c61531a5f3c5b6a25024868c17263
parent7af4df7f5813d144d8aa730ba5ecd624dfcf53c8
ixgbe: Convert to use devm_hwmon_device_register_with_groups

Simplify the code. Attach hwmon sysfs attributes to hwmon device
instead of pci device. Avoid race conditions caused by attributes
being created after hwmon device registration. Implicitly
(through hwmon API) add mandatory 'name' sysfs attribute.

Other cleanup:

Instead of allocating memory for hwmon attributes, move attributes
and all other hwmon related data into struct hwmon_buff and allocate
the entire structure using devm_kzalloc.

Check return value from calls to igb_add_hwmon_attr() one by one instead
of logically combining them all together.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ixgbe/ixgbe.h
drivers/net/ethernet/intel/ixgbe/ixgbe_sysfs.c