Merge tag 'driver-core-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg KH: "Here is the small set of driver core and kernfs changes for 6.10-rc1. Nothing major here at all, just a small set of changes for some driver core apis, and minor fixups. Included in here are: - sysfs_bin_attr_simple_read() helper added and used - device_show_string() helper added and used All usages of these were acked by the various maintainers. Also in here are: - kernfs minor cleanup - removed unused functions - typo fix in documentation - pay attention to sysfs_create_link() failures in module.c finally All of these have been in linux-next for a very long time with no reported problems" * tag 'driver-core-6.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: device property: Fix a typo in the description of device_get_child_node_count() kernfs: mount: Remove unnecessary ‘NULL’ values from knparent scsi: Use device_show_string() helper for sysfs attributes platform/x86: Use device_show_string() helper for sysfs attributes perf: Use device_show_string() helper for sysfs attributes IB/qib: Use device_show_string() helper for sysfs attributes hwmon: Use device_show_string() helper for sysfs attributes driver core: Add device_show_string() helper for sysfs attributes treewide: Use sysfs_bin_attr_simple_read() helper sysfs: Add sysfs_bin_attr_simple_read() helper module: don't ignore sysfs_create_link() failures driver core: Remove unused platform_notify, platform_notify_remove
This commit is contained in:
+15
-11
@@ -132,6 +132,8 @@ ssize_t device_show_bool(struct device *dev, struct device_attribute *attr,
|
||||
char *buf);
|
||||
ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t count);
|
||||
ssize_t device_show_string(struct device *dev, struct device_attribute *attr,
|
||||
char *buf);
|
||||
|
||||
/**
|
||||
* DEVICE_ATTR - Define a device attribute.
|
||||
@@ -251,6 +253,19 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
|
||||
struct dev_ext_attribute dev_attr_##_name = \
|
||||
{ __ATTR(_name, _mode, device_show_bool, device_store_bool), &(_var) }
|
||||
|
||||
/**
|
||||
* DEVICE_STRING_ATTR_RO - Define a device attribute backed by a r/o string.
|
||||
* @_name: Attribute name.
|
||||
* @_mode: File mode.
|
||||
* @_var: Identifier of string.
|
||||
*
|
||||
* Like DEVICE_ULONG_ATTR(), but @_var is a string. Because the length of the
|
||||
* string allocation is unknown, the attribute must be read-only.
|
||||
*/
|
||||
#define DEVICE_STRING_ATTR_RO(_name, _mode, _var) \
|
||||
struct dev_ext_attribute dev_attr_##_name = \
|
||||
{ __ATTR(_name, (_mode) & ~0222, device_show_string, NULL), (_var) }
|
||||
|
||||
#define DEVICE_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \
|
||||
struct device_attribute dev_attr_##_name = \
|
||||
__ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store)
|
||||
@@ -1210,17 +1225,6 @@ int __must_check devm_device_add_groups(struct device *dev,
|
||||
int __must_check devm_device_add_group(struct device *dev,
|
||||
const struct attribute_group *grp);
|
||||
|
||||
/*
|
||||
* Platform "fixup" functions - allow the platform to have their say
|
||||
* about devices and actions that the general device layer doesn't
|
||||
* know about.
|
||||
*/
|
||||
/* Notify platform of device discovery */
|
||||
extern int (*platform_notify)(struct device *dev);
|
||||
|
||||
extern int (*platform_notify_remove)(struct device *dev);
|
||||
|
||||
|
||||
/*
|
||||
* get_device - atomically increment the reference count for the device.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user