Commit 55cb93fd authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'driver-core-6.13-rc1' of...

Merge tag 'driver-core-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core updates from Greg KH:
 "Here is a small set of driver core changes for 6.13-rc1.

  Nothing major for this merge cycle, except for the two simple merge
  conflicts are here just to make life interesting.

  Included in here are:

   - sysfs core changes and preparations for more sysfs api cleanups
     that can come through all driver trees after -rc1 is out

   - fw_devlink fixes based on many reports and debugging sessions

   - list_for_each_reverse() removal, no one was using it!

   - last-minute seq_printf() format string bug found and fixed in many
     drivers all at once.

   - minor bugfixes and changes full details in the shortlog"

* tag 'driver-core-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (35 commits)
  Fix a potential abuse of seq_printf() format string in drivers
  cpu: Remove spurious NULL in attribute_group definition
  s390/con3215: Remove spurious NULL in attribute_group definition
  perf: arm-ni: Remove spurious NULL in attribute_group definition
  driver core: Constify bin_attribute definitions
  sysfs: attribute_group: allow registration of const bin_attribute
  firmware_loader: Fix possible resource leak in fw_log_firmware_info()
  drivers: core: fw_devlink: Fix excess parameter description in docstring
  driver core: class: Correct WARN() message in APIs class_(for_each|find)_device()
  cacheinfo: Use of_property_present() for non-boolean properties
  cdx: Fix cdx_mmap_resource() after constifying attr in ->mmap()
  drivers: core: fw_devlink: Make the error message a bit more useful
  phy: tegra: xusb: Set fwnode for xusb port devices
  drm: display: Set fwnode for aux bus devices
  driver core: fw_devlink: Stop trying to optimize cycle detection logic
  driver core: Constify attribute arguments of binary attributes
  sysfs: bin_attribute: add const read/write callback variants
  sysfs: implement all BIN_ATTR_* macros in terms of __BIN_ATTR()
  sysfs: treewide: constify attribute callback of bin_attribute::llseek()
  sysfs: treewide: constify attribute callback of bin_attribute::mmap()
  ...
parents a0c1ca39 acfeb6de
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ Auxiliary Device Creation

.. kernel-doc:: drivers/base/auxiliary.c
   :identifiers: auxiliary_device_init __auxiliary_device_add
                 auxiliary_find_device

Auxiliary Device Memory Model and Lifespan
------------------------------------------
+3 −3
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ static int __pci_mmap_fits(struct pci_dev *pdev, int num,
 * Return: %0 on success, negative error code otherwise
 */
static int pci_mmap_resource(struct kobject *kobj,
			     struct bin_attribute *attr,
			     const struct bin_attribute *attr,
			     struct vm_area_struct *vma, int sparse)
{
	struct pci_dev *pdev = to_pci_dev(kobj_to_dev(kobj));
@@ -93,14 +93,14 @@ static int pci_mmap_resource(struct kobject *kobj,
}

static int pci_mmap_resource_sparse(struct file *filp, struct kobject *kobj,
				    struct bin_attribute *attr,
				    const struct bin_attribute *attr,
				    struct vm_area_struct *vma)
{
	return pci_mmap_resource(kobj, attr, vma, 1);
}

static int pci_mmap_resource_dense(struct file *filp, struct kobject *kobj,
				   struct bin_attribute *attr,
				   const struct bin_attribute *attr,
				   struct vm_area_struct *vma)
{
	return pci_mmap_resource(kobj, attr, vma, 0);
+1 −30
Original line number Diff line number Diff line
@@ -92,7 +92,7 @@
 * Auxiliary devices are created and registered by a subsystem-level core
 * device that needs to break up its functionality into smaller fragments. One
 * way to extend the scope of an auxiliary_device is to encapsulate it within a
 * domain- pecific structure defined by the parent device. This structure
 * domain-specific structure defined by the parent device. This structure
 * contains the auxiliary_device and any associated shared data/callbacks
 * needed to establish the connection with the parent.
 *
@@ -335,35 +335,6 @@ int __auxiliary_device_add(struct auxiliary_device *auxdev, const char *modname)
}
EXPORT_SYMBOL_GPL(__auxiliary_device_add);

/**
 * auxiliary_find_device - auxiliary device iterator for locating a particular device.
 * @start: Device to begin with
 * @data: Data to pass to match function
 * @match: Callback function to check device
 *
 * This function returns a reference to a device that is 'found'
 * for later use, as determined by the @match callback.
 *
 * The reference returned should be released with put_device().
 *
 * The callback should return 0 if the device doesn't match and non-zero
 * if it does.  If the callback returns non-zero, this function will
 * return to the caller and not iterate over any more devices.
 */
struct auxiliary_device *auxiliary_find_device(struct device *start,
					       const void *data,
					       device_match_t match)
{
	struct device *dev;

	dev = bus_find_device(&auxiliary_bus_type, start, data, match);
	if (!dev)
		return NULL;

	return to_auxiliary_dev(dev);
}
EXPORT_SYMBOL_GPL(auxiliary_find_device);

/**
 * __auxiliary_driver_register - register a driver for auxiliary bus devices
 * @auxdrv: auxiliary_driver structure
+5 −10
Original line number Diff line number Diff line
@@ -254,11 +254,11 @@ static int of_count_cache_leaves(struct device_node *np)
{
	unsigned int leaves = 0;

	if (of_property_read_bool(np, "cache-size"))
	if (of_property_present(np, "cache-size"))
		++leaves;
	if (of_property_read_bool(np, "i-cache-size"))
	if (of_property_present(np, "i-cache-size"))
		++leaves;
	if (of_property_read_bool(np, "d-cache-size"))
	if (of_property_present(np, "d-cache-size"))
		++leaves;

	if (!leaves) {
@@ -367,9 +367,7 @@ static int cache_shared_cpu_map_setup(unsigned int cpu)

		cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map);
		for_each_online_cpu(i) {
			struct cpu_cacheinfo *sib_cpu_ci = get_cpu_cacheinfo(i);

			if (i == cpu || !sib_cpu_ci->info_list)
			if (i == cpu || !per_cpu_cacheinfo(i))
				continue;/* skip if itself or no cacheinfo */
			for (sib_index = 0; sib_index < cache_leaves(i); sib_index++) {
				sib_leaf = per_cpu_cacheinfo_idx(i, sib_index);
@@ -409,10 +407,7 @@ static void cache_shared_cpu_map_remove(unsigned int cpu)
	for (index = 0; index < cache_leaves(cpu); index++) {
		this_leaf = per_cpu_cacheinfo_idx(cpu, index);
		for_each_cpu(sibling, &this_leaf->shared_cpu_map) {
			struct cpu_cacheinfo *sib_cpu_ci =
						get_cpu_cacheinfo(sibling);

			if (sibling == cpu || !sib_cpu_ci->info_list)
			if (sibling == cpu || !per_cpu_cacheinfo(sibling))
				continue;/* skip if itself or no cacheinfo */

			for (sib_index = 0; sib_index < cache_leaves(sibling); sib_index++) {
+2 −2
Original line number Diff line number Diff line
@@ -405,7 +405,7 @@ int class_for_each_device(const struct class *class, const struct device *start,
	if (!class)
		return -EINVAL;
	if (!sp) {
		WARN(1, "%s called for class '%s' before it was initialized",
		WARN(1, "%s called for class '%s' before it was registered",
		     __func__, class->name);
		return -EINVAL;
	}
@@ -453,7 +453,7 @@ struct device *class_find_device(const struct class *class, const struct device
	if (!class)
		return NULL;
	if (!sp) {
		WARN(1, "%s called for class '%s' before it was initialized",
		WARN(1, "%s called for class '%s' before it was registered",
		     __func__, class->name);
		return NULL;
	}
Loading