Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9929780e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull driver core updates from Greg KH:
 "Here are the "big" driver core patches for 4.9-rc1. Also in here are a
  number of debugfs fixes that cropped up due to the changes that
  happened in 4.8 for that filesystem. Overall, nothing major, just a
  few fixes and cleanups.

  All of these have been in linux-next with no reported issues"

* tag 'driver-core-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (23 commits)
  drivers: dma-coherent: Move spinlock in dma_alloc_from_coherent()
  drivers: dma-coherent: Fix DMA coherent size for less than page
  MAINTAINERS: extend firmware_class maintainer list
  debugfs: propagate release() call result
  driver-core: platform: Catch errors from calls to irq_get_irq_data
  sysfs print name of undiscoverable attribute group
  carl9170: fix debugfs crashes
  b43legacy: fix debugfs crash
  b43: fix debugfs crash
  debugfs: introduce a public file_operations accessor
  device core: Remove deprecated create_singlethread_workqueue
  drivers/base dmam_declare_coherent_memory leaks
  platform: don't return 0 from platform_get_irq[_byname]() on error
  cpu: clean up register_cpu func
  dma-mapping: use vma_pages().
  drivers: dma-coherent: use vma_pages().
  attribute_container: Fix typo
  base: soc: make it explicitly non-modular
  drivers: base: dma-mapping: page align the size when unmap_kernel_range
  platform driver: fix use-after-free in platform_device_del()
  ...
parents 7a53eea1 dd01c75f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4866,6 +4866,7 @@ F: tools/firewire/

FIRMWARE LOADER (request_firmware)
M:	Ming Lei <ming.lei@canonical.com>
M:	Luis R. Rodriguez <mcgrof@kernel.org>
L:	linux-kernel@vger.kernel.org
S:	Maintained
F:	Documentation/firmware_class/
+10 −0
Original line number Diff line number Diff line
@@ -212,6 +212,16 @@ config DEBUG_DEVRES

	  If you are unsure about this, Say N here.

config DEBUG_TEST_DRIVER_REMOVE
	bool "Test driver remove calls during probe"
	depends on DEBUG_KERNEL
	help
	  Say Y here if you want the Driver core to test driver remove functions
	  by calling probe, remove, probe. This tests the remove path without
	  having to unbind the driver or unload the driver module.

	  If you are unsure about this, say N here.

config SYS_HYPERVISOR
	bool
	default n
+1 −1
Original line number Diff line number Diff line
@@ -243,7 +243,7 @@ attribute_container_remove_device(struct device *dev,
 * @dev:  The generic device to run the trigger for
 * @fn	  the function to execute for each classdev.
 *
 * This funcion is for executing a trigger when you need to know both
 * This function is for executing a trigger when you need to know both
 * the container and the classdev.  If you only care about the
 * container, then use attribute_container_trigger() instead.
 */
+29 −10
Original line number Diff line number Diff line
@@ -836,11 +836,29 @@ static struct kobject *get_device_parent(struct device *dev,
	return NULL;
}

static inline bool live_in_glue_dir(struct kobject *kobj,
				    struct device *dev)
{
	if (!kobj || !dev->class ||
	    kobj->kset != &dev->class->p->glue_dirs)
		return false;
	return true;
}

static inline struct kobject *get_glue_dir(struct device *dev)
{
	return dev->kobj.parent;
}

/*
 * make sure cleaning up dir as the last step, we need to make
 * sure .release handler of kobject is run with holding the
 * global lock
 */
static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
{
	/* see if we live in a "glue" directory */
	if (!glue_dir || !dev->class ||
	    glue_dir->kset != &dev->class->p->glue_dirs)
	if (!live_in_glue_dir(glue_dir, dev))
		return;

	mutex_lock(&gdp_mutex);
@@ -848,11 +866,6 @@ static void cleanup_glue_dir(struct device *dev, struct kobject *glue_dir)
	mutex_unlock(&gdp_mutex);
}

static void cleanup_device_parent(struct device *dev)
{
	cleanup_glue_dir(dev, dev->kobj.parent);
}

static int device_add_class_symlinks(struct device *dev)
{
	struct device_node *of_node = dev_of_node(dev);
@@ -1028,6 +1041,7 @@ int device_add(struct device *dev)
	struct kobject *kobj;
	struct class_interface *class_intf;
	int error = -EINVAL;
	struct kobject *glue_dir = NULL;

	dev = get_device(dev);
	if (!dev)
@@ -1072,8 +1086,10 @@ int device_add(struct device *dev)
	/* first, register with generic layer. */
	/* we require the name to be set before, and pass NULL */
	error = kobject_add(&dev->kobj, dev->kobj.parent, NULL);
	if (error)
	if (error) {
		glue_dir = get_glue_dir(dev);
		goto Error;
	}

	/* notify platform of device entry */
	if (platform_notify)
@@ -1154,9 +1170,10 @@ int device_add(struct device *dev)
	device_remove_file(dev, &dev_attr_uevent);
 attrError:
	kobject_uevent(&dev->kobj, KOBJ_REMOVE);
	glue_dir = get_glue_dir(dev);
	kobject_del(&dev->kobj);
 Error:
	cleanup_device_parent(dev);
	cleanup_glue_dir(dev, glue_dir);
	put_device(parent);
name_error:
	kfree(dev->p);
@@ -1232,6 +1249,7 @@ EXPORT_SYMBOL_GPL(put_device);
void device_del(struct device *dev)
{
	struct device *parent = dev->parent;
	struct kobject *glue_dir = NULL;
	struct class_interface *class_intf;

	/* Notify clients of device removal.  This call must come
@@ -1277,8 +1295,9 @@ void device_del(struct device *dev)
		blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
					     BUS_NOTIFY_REMOVED_DEVICE, dev);
	kobject_uevent(&dev->kobj, KOBJ_REMOVE);
	cleanup_device_parent(dev);
	glue_dir = get_glue_dir(dev);
	kobject_del(&dev->kobj);
	cleanup_glue_dir(dev, glue_dir);
	put_device(parent);
}
EXPORT_SYMBOL_GPL(device_del);
+6 −5
Original line number Diff line number Diff line
@@ -371,12 +371,13 @@ int register_cpu(struct cpu *cpu, int num)
	if (cpu->hotpluggable)
		cpu->dev.groups = hotplugable_cpu_attr_groups;
	error = device_register(&cpu->dev);
	if (!error)
	if (error)
		return error;

	per_cpu(cpu_sys_devices, num) = &cpu->dev;
	if (!error)
	register_cpu_under_node(num, cpu_to_node(num));

	return error;
	return 0;
}

struct device *get_cpu_device(unsigned cpu)
Loading