forked from mirrors/linux
		
	hwmon: (core) Rename groups parameter in API to extra_groups
The 'groups' parameter of hwmon_device_register_with_info() and devm_hwmon_device_register_with_info() is only necessary if extra non-standard attributes need to be provided. Rename the parameter to extra_groups and clarify the documentation. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
		
							parent
							
								
									b2a4cc3a06
								
							
						
					
					
						commit
						848ba0a2f2
					
				
					 3 changed files with 19 additions and 19 deletions
				
			
		| 
						 | 
					@ -37,14 +37,14 @@ struct device *
 | 
				
			||||||
hwmon_device_register_with_info(struct device *dev,
 | 
					hwmon_device_register_with_info(struct device *dev,
 | 
				
			||||||
				const char *name, void *drvdata,
 | 
									const char *name, void *drvdata,
 | 
				
			||||||
				const struct hwmon_chip_info *info,
 | 
									const struct hwmon_chip_info *info,
 | 
				
			||||||
				const struct attribute_group **groups);
 | 
									const struct attribute_group **extra_groups);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct device *
 | 
					struct device *
 | 
				
			||||||
devm_hwmon_device_register_with_info(struct device *dev,
 | 
					devm_hwmon_device_register_with_info(struct device *dev,
 | 
				
			||||||
				     const char *name,
 | 
									const char *name,
 | 
				
			||||||
				     void *drvdata,
 | 
									void *drvdata,
 | 
				
			||||||
				     const struct hwmon_chip_info *info,
 | 
									const struct hwmon_chip_info *info,
 | 
				
			||||||
				     const struct attribute_group **groups);
 | 
									const struct attribute_group **extra_groups);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void hwmon_device_unregister(struct device *dev);
 | 
					void hwmon_device_unregister(struct device *dev);
 | 
				
			||||||
void devm_hwmon_device_unregister(struct device *dev);
 | 
					void devm_hwmon_device_unregister(struct device *dev);
 | 
				
			||||||
| 
						 | 
					@ -100,9 +100,9 @@ const char *name	Device name
 | 
				
			||||||
void *drvdata		Driver private data
 | 
					void *drvdata		Driver private data
 | 
				
			||||||
const struct hwmon_chip_info *info
 | 
					const struct hwmon_chip_info *info
 | 
				
			||||||
			Pointer to chip description.
 | 
								Pointer to chip description.
 | 
				
			||||||
const struct attribute_group **groups
 | 
					const struct attribute_group **extra_groups
 | 
				
			||||||
			Null-terminated list of additional sysfs attribute
 | 
								Null-terminated list of additional non-standard
 | 
				
			||||||
			groups.
 | 
								sysfs attribute groups.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
This function returns a pointer to the created hardware monitoring device
 | 
					This function returns a pointer to the created hardware monitoring device
 | 
				
			||||||
on success and a negative error code for failure.
 | 
					on success and a negative error code for failure.
 | 
				
			||||||
| 
						 | 
					@ -287,9 +287,9 @@ Driver-provided sysfs attributes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If the hardware monitoring device is registered with
 | 
					If the hardware monitoring device is registered with
 | 
				
			||||||
hwmon_device_register_with_info or devm_hwmon_device_register_with_info,
 | 
					hwmon_device_register_with_info or devm_hwmon_device_register_with_info,
 | 
				
			||||||
it is most likely not necessary to provide sysfs attributes. Only non-standard
 | 
					it is most likely not necessary to provide sysfs attributes. Only additional
 | 
				
			||||||
sysfs attributes need to be provided when one of those registration functions
 | 
					non-standard sysfs attributes need to be provided when one of those registration
 | 
				
			||||||
is used.
 | 
					functions is used.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The header file linux/hwmon-sysfs.h provides a number of useful macros to
 | 
					The header file linux/hwmon-sysfs.h provides a number of useful macros to
 | 
				
			||||||
declare and use hardware monitoring sysfs attributes.
 | 
					declare and use hardware monitoring sysfs attributes.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -659,8 +659,8 @@ EXPORT_SYMBOL_GPL(hwmon_device_register_with_groups);
 | 
				
			||||||
 * @dev: the parent device
 | 
					 * @dev: the parent device
 | 
				
			||||||
 * @name: hwmon name attribute
 | 
					 * @name: hwmon name attribute
 | 
				
			||||||
 * @drvdata: driver data to attach to created device
 | 
					 * @drvdata: driver data to attach to created device
 | 
				
			||||||
 * @info: Pointer to hwmon chip information
 | 
					 * @info: pointer to hwmon chip information
 | 
				
			||||||
 * @groups - pointer to list of driver specific attribute groups
 | 
					 * @extra_groups: pointer to list of additional non-standard attribute groups
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
 * hwmon_device_unregister() must be called when the device is no
 | 
					 * hwmon_device_unregister() must be called when the device is no
 | 
				
			||||||
 * longer needed.
 | 
					 * longer needed.
 | 
				
			||||||
| 
						 | 
					@ -671,12 +671,12 @@ struct device *
 | 
				
			||||||
hwmon_device_register_with_info(struct device *dev, const char *name,
 | 
					hwmon_device_register_with_info(struct device *dev, const char *name,
 | 
				
			||||||
				void *drvdata,
 | 
									void *drvdata,
 | 
				
			||||||
				const struct hwmon_chip_info *chip,
 | 
									const struct hwmon_chip_info *chip,
 | 
				
			||||||
				const struct attribute_group **groups)
 | 
									const struct attribute_group **extra_groups)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (chip && (!chip->ops || !chip->ops->is_visible || !chip->info))
 | 
						if (chip && (!chip->ops || !chip->ops->is_visible || !chip->info))
 | 
				
			||||||
		return ERR_PTR(-EINVAL);
 | 
							return ERR_PTR(-EINVAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return __hwmon_device_register(dev, name, drvdata, chip, groups);
 | 
						return __hwmon_device_register(dev, name, drvdata, chip, extra_groups);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
EXPORT_SYMBOL_GPL(hwmon_device_register_with_info);
 | 
					EXPORT_SYMBOL_GPL(hwmon_device_register_with_info);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -377,12 +377,12 @@ struct device *
 | 
				
			||||||
hwmon_device_register_with_info(struct device *dev,
 | 
					hwmon_device_register_with_info(struct device *dev,
 | 
				
			||||||
				const char *name, void *drvdata,
 | 
									const char *name, void *drvdata,
 | 
				
			||||||
				const struct hwmon_chip_info *info,
 | 
									const struct hwmon_chip_info *info,
 | 
				
			||||||
				const struct attribute_group **groups);
 | 
									const struct attribute_group **extra_groups);
 | 
				
			||||||
struct device *
 | 
					struct device *
 | 
				
			||||||
devm_hwmon_device_register_with_info(struct device *dev,
 | 
					devm_hwmon_device_register_with_info(struct device *dev,
 | 
				
			||||||
				     const char *name, void *drvdata,
 | 
									const char *name, void *drvdata,
 | 
				
			||||||
				     const struct hwmon_chip_info *info,
 | 
									const struct hwmon_chip_info *info,
 | 
				
			||||||
				     const struct attribute_group **groups);
 | 
									const struct attribute_group **extra_groups);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void hwmon_device_unregister(struct device *dev);
 | 
					void hwmon_device_unregister(struct device *dev);
 | 
				
			||||||
void devm_hwmon_device_unregister(struct device *dev);
 | 
					void devm_hwmon_device_unregister(struct device *dev);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue