You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6: (36 commits) SCSI: convert struct class_device to struct device DRM: remove unused dev_class IB: rename "dev" to "srp_dev" in srp_host structure IB: convert struct class_device to struct device memstick: convert struct class_device to struct device driver core: replace remaining __FUNCTION__ occurrences sysfs: refill attribute buffer when reading from offset 0 PM: Remove destroy_suspended_device() Firmware: add iSCSI iBFT Support PM: Remove legacy PM (fix) Kobject: Replace list_for_each() with list_for_each_entry(). SYSFS: Explicitly include required header file slab.h. Driver core: make device_is_registered() work for class devices PM: Convert wakeup flag accessors to inline functions PM: Make wakeup flags available whenever CONFIG_PM is set PM: Fix misuse of wakeup flag accessors in serial core Driver core: Call device_pm_add() after bus_add_device() in device_add() PM: Handle device registrations during suspend/resume block: send disk "change" event for rescan_partitions() sysdev: detect multiple driver registrations ... Fixed trivial conflict in include/linux/memory.h due to semaphore header file change (made irrelevant by the change to mutex).
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
What: /sys/firmware/ibft/initiator
|
||||
Date: November 2007
|
||||
Contact: Konrad Rzeszutek <ketuzsezr@darnok.org>
|
||||
Description: The /sys/firmware/ibft/initiator directory will contain
|
||||
files that expose the iSCSI Boot Firmware Table initiator data.
|
||||
Usually this contains the Initiator name.
|
||||
|
||||
What: /sys/firmware/ibft/targetX
|
||||
Date: November 2007
|
||||
Contact: Konrad Rzeszutek <ketuzsezr@darnok.org>
|
||||
Description: The /sys/firmware/ibft/targetX directory will contain
|
||||
files that expose the iSCSI Boot Firmware Table target data.
|
||||
Usually this contains the target's IP address, boot LUN,
|
||||
target name, and what NIC it is associated with. It can also
|
||||
contain the CHAP name (and password), the reverse CHAP
|
||||
name (and password)
|
||||
|
||||
What: /sys/firmware/ibft/ethernetX
|
||||
Date: November 2007
|
||||
Contact: Konrad Rzeszutek <ketuzsezr@darnok.org>
|
||||
Description: The /sys/firmware/ibft/ethernetX directory will contain
|
||||
files that expose the iSCSI Boot Firmware Table NIC data.
|
||||
This can this can the IP address, MAC, and gateway of the NIC.
|
||||
@@ -297,11 +297,6 @@ X!Earch/x86/kernel/mca_32.c
|
||||
!Ikernel/acct.c
|
||||
</chapter>
|
||||
|
||||
<chapter id="pmfuncs">
|
||||
<title>Power Management</title>
|
||||
!Ekernel/power/pm.c
|
||||
</chapter>
|
||||
|
||||
<chapter id="devdrivers">
|
||||
<title>Device drivers infrastructure</title>
|
||||
<sect1><title>Device Drivers Base</title>
|
||||
|
||||
@@ -176,8 +176,10 @@ implementations:
|
||||
Recall that an attribute should only be exporting one value, or an
|
||||
array of similar values, so this shouldn't be that expensive.
|
||||
|
||||
This allows userspace to do partial reads and seeks arbitrarily over
|
||||
the entire file at will.
|
||||
This allows userspace to do partial reads and forward seeks
|
||||
arbitrarily over the entire file at will. If userspace seeks back to
|
||||
zero or does a pread(2) with an offset of '0' the show() method will
|
||||
be called again, rearmed, to fill the buffer.
|
||||
|
||||
- On write(2), sysfs expects the entire buffer to be passed during the
|
||||
first write. Sysfs then passes the entire buffer to the store()
|
||||
@@ -192,6 +194,9 @@ implementations:
|
||||
|
||||
Other notes:
|
||||
|
||||
- Writing causes the show() method to be rearmed regardless of current
|
||||
file position.
|
||||
|
||||
- The buffer will always be PAGE_SIZE bytes in length. On i386, this
|
||||
is 4096.
|
||||
|
||||
|
||||
@@ -196,6 +196,11 @@ its parent; and can't be removed or suspended after that parent.
|
||||
|
||||
The policy is that the device tree should match hardware bus topology.
|
||||
(Or at least the control bus, for devices which use multiple busses.)
|
||||
In particular, this means that a device registration may fail if the parent of
|
||||
the device is suspending (ie. has been chosen by the PM core as the next
|
||||
device to suspend) or has already suspended, as well as after all of the other
|
||||
devices have been suspended. Device drivers must be prepared to cope with such
|
||||
situations.
|
||||
|
||||
|
||||
Suspending Devices
|
||||
|
||||
@@ -3610,6 +3610,11 @@ M: mhoffman@lightlink.com
|
||||
L: lm-sensors@lm-sensors.org
|
||||
S: Maintained
|
||||
|
||||
SMX UIO Interface
|
||||
P: Ben Nizette
|
||||
M: bn@niasdigital.com
|
||||
S: Maintained
|
||||
|
||||
SOFTWARE RAID (Multiple Disks) SUPPORT
|
||||
P: Ingo Molnar
|
||||
M: mingo@redhat.com
|
||||
|
||||
@@ -1192,6 +1192,8 @@ source "drivers/dma/Kconfig"
|
||||
|
||||
source "drivers/dca/Kconfig"
|
||||
|
||||
source "drivers/uio/Kconfig"
|
||||
|
||||
endmenu
|
||||
|
||||
source "fs/Kconfig"
|
||||
|
||||
@@ -154,12 +154,10 @@ static int __cpuinit cpuid_class_cpu_callback(struct notifier_block *nfb,
|
||||
err = cpuid_device_create(cpu);
|
||||
break;
|
||||
case CPU_UP_CANCELED:
|
||||
case CPU_UP_CANCELED_FROZEN:
|
||||
case CPU_DEAD:
|
||||
cpuid_device_destroy(cpu);
|
||||
break;
|
||||
case CPU_UP_CANCELED_FROZEN:
|
||||
destroy_suspended_device(cpuid_class, MKDEV(CPUID_MAJOR, cpu));
|
||||
break;
|
||||
}
|
||||
return err ? NOTIFY_BAD : NOTIFY_OK;
|
||||
}
|
||||
|
||||
@@ -162,12 +162,10 @@ static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb,
|
||||
err = msr_device_create(cpu);
|
||||
break;
|
||||
case CPU_UP_CANCELED:
|
||||
case CPU_UP_CANCELED_FROZEN:
|
||||
case CPU_DEAD:
|
||||
msr_device_destroy(cpu);
|
||||
break;
|
||||
case CPU_UP_CANCELED_FROZEN:
|
||||
destroy_suspended_device(msr_class, MKDEV(MSR_MAJOR, cpu));
|
||||
break;
|
||||
}
|
||||
return err ? NOTIFY_BAD : NOTIFY_OK;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <linux/efi.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/edd.h>
|
||||
#include <linux/iscsi_ibft.h>
|
||||
#include <linux/nodemask.h>
|
||||
#include <linux/kexec.h>
|
||||
#include <linux/crash_dump.h>
|
||||
@@ -689,6 +690,8 @@ void __init setup_bootmem_allocator(void)
|
||||
#endif
|
||||
numa_kva_reserve();
|
||||
reserve_crashkernel();
|
||||
|
||||
reserve_ibft_region();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/kallsyms.h>
|
||||
#include <linux/edd.h>
|
||||
#include <linux/iscsi_ibft.h>
|
||||
#include <linux/mmzone.h>
|
||||
#include <linux/kexec.h>
|
||||
#include <linux/cpufreq.h>
|
||||
@@ -439,6 +440,9 @@ void __init setup_arch(char **cmdline_p)
|
||||
}
|
||||
#endif
|
||||
reserve_crashkernel();
|
||||
|
||||
reserve_ibft_region();
|
||||
|
||||
paging_init();
|
||||
map_vsyscall();
|
||||
|
||||
|
||||
+5
-6
@@ -758,7 +758,7 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
|
||||
mutex_lock(&bsg_mutex);
|
||||
hlist_add_head(&bd->dev_list, bsg_dev_idx_hash(iminor(inode)));
|
||||
|
||||
strncpy(bd->name, rq->bsg_dev.class_dev->class_id, sizeof(bd->name) - 1);
|
||||
strncpy(bd->name, rq->bsg_dev.class_dev->bus_id, sizeof(bd->name) - 1);
|
||||
dprintk("bound to <%s>, max queue %d\n",
|
||||
format_dev_t(buf, inode->i_rdev), bd->max_queue);
|
||||
|
||||
@@ -946,7 +946,7 @@ void bsg_unregister_queue(struct request_queue *q)
|
||||
mutex_lock(&bsg_mutex);
|
||||
idr_remove(&bsg_minor_idr, bcd->minor);
|
||||
sysfs_remove_link(&q->kobj, "bsg");
|
||||
class_device_unregister(bcd->class_dev);
|
||||
device_unregister(bcd->class_dev);
|
||||
put_device(bcd->dev);
|
||||
bcd->class_dev = NULL;
|
||||
mutex_unlock(&bsg_mutex);
|
||||
@@ -959,7 +959,7 @@ int bsg_register_queue(struct request_queue *q, struct device *gdev,
|
||||
struct bsg_class_device *bcd;
|
||||
dev_t dev;
|
||||
int ret, minor;
|
||||
struct class_device *class_dev = NULL;
|
||||
struct device *class_dev = NULL;
|
||||
const char *devname;
|
||||
|
||||
if (name)
|
||||
@@ -998,8 +998,7 @@ int bsg_register_queue(struct request_queue *q, struct device *gdev,
|
||||
bcd->queue = q;
|
||||
bcd->dev = get_device(gdev);
|
||||
dev = MKDEV(bsg_major, bcd->minor);
|
||||
class_dev = class_device_create(bsg_class, NULL, dev, gdev, "%s",
|
||||
devname);
|
||||
class_dev = device_create(bsg_class, gdev, dev, "%s", devname);
|
||||
if (IS_ERR(class_dev)) {
|
||||
ret = PTR_ERR(class_dev);
|
||||
goto put_dev;
|
||||
@@ -1016,7 +1015,7 @@ int bsg_register_queue(struct request_queue *q, struct device *gdev,
|
||||
return 0;
|
||||
|
||||
unregister_class_dev:
|
||||
class_device_unregister(class_dev);
|
||||
device_unregister(class_dev);
|
||||
put_dev:
|
||||
put_device(gdev);
|
||||
remove_idr:
|
||||
|
||||
+2
-2
@@ -273,8 +273,8 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
|
||||
static int ahci_pci_device_resume(struct pci_dev *pdev);
|
||||
#endif
|
||||
|
||||
static struct class_device_attribute *ahci_shost_attrs[] = {
|
||||
&class_device_attr_link_power_management_policy,
|
||||
static struct device_attribute *ahci_shost_attrs[] = {
|
||||
&dev_attr_link_power_management_policy,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -131,10 +131,11 @@ static const char *ata_scsi_lpm_get(enum link_pm policy)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static ssize_t ata_scsi_lpm_put(struct class_device *class_dev,
|
||||
const char *buf, size_t count)
|
||||
static ssize_t ata_scsi_lpm_put(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct Scsi_Host *shost = class_to_shost(class_dev);
|
||||
struct Scsi_Host *shost = class_to_shost(dev);
|
||||
struct ata_port *ap = ata_shost_to_port(shost);
|
||||
enum link_pm policy = 0;
|
||||
int i;
|
||||
@@ -162,9 +163,9 @@ static ssize_t ata_scsi_lpm_put(struct class_device *class_dev,
|
||||
}
|
||||
|
||||
static ssize_t
|
||||
ata_scsi_lpm_show(struct class_device *class_dev, char *buf)
|
||||
ata_scsi_lpm_show(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct Scsi_Host *shost = class_to_shost(class_dev);
|
||||
struct Scsi_Host *shost = class_to_shost(dev);
|
||||
struct ata_port *ap = ata_shost_to_port(shost);
|
||||
const char *policy =
|
||||
ata_scsi_lpm_get(ap->pm_policy);
|
||||
@@ -174,9 +175,9 @@ ata_scsi_lpm_show(struct class_device *class_dev, char *buf)
|
||||
|
||||
return snprintf(buf, 23, "%s\n", policy);
|
||||
}
|
||||
CLASS_DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
|
||||
DEVICE_ATTR(link_power_management_policy, S_IRUGO | S_IWUSR,
|
||||
ata_scsi_lpm_show, ata_scsi_lpm_put);
|
||||
EXPORT_SYMBOL_GPL(class_device_attr_link_power_management_policy);
|
||||
EXPORT_SYMBOL_GPL(dev_attr_link_power_management_policy);
|
||||
|
||||
static void ata_scsi_invalid_field(struct scsi_cmnd *cmd,
|
||||
void (*done)(struct scsi_cmnd *))
|
||||
|
||||
@@ -27,21 +27,21 @@
|
||||
struct internal_container {
|
||||
struct klist_node node;
|
||||
struct attribute_container *cont;
|
||||
struct class_device classdev;
|
||||
struct device classdev;
|
||||
};
|
||||
|
||||
static void internal_container_klist_get(struct klist_node *n)
|
||||
{
|
||||
struct internal_container *ic =
|
||||
container_of(n, struct internal_container, node);
|
||||
class_device_get(&ic->classdev);
|
||||
get_device(&ic->classdev);
|
||||
}
|
||||
|
||||
static void internal_container_klist_put(struct klist_node *n)
|
||||
{
|
||||
struct internal_container *ic =
|
||||
container_of(n, struct internal_container, node);
|
||||
class_device_put(&ic->classdev);
|
||||
put_device(&ic->classdev);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ static void internal_container_klist_put(struct klist_node *n)
|
||||
* Returns the container associated with this classdev.
|
||||
*/
|
||||
struct attribute_container *
|
||||
attribute_container_classdev_to_container(struct class_device *classdev)
|
||||
attribute_container_classdev_to_container(struct device *classdev)
|
||||
{
|
||||
struct internal_container *ic =
|
||||
container_of(classdev, struct internal_container, classdev);
|
||||
@@ -110,11 +110,11 @@ attribute_container_unregister(struct attribute_container *cont)
|
||||
EXPORT_SYMBOL_GPL(attribute_container_unregister);
|
||||
|
||||
/* private function used as class release */
|
||||
static void attribute_container_release(struct class_device *classdev)
|
||||
static void attribute_container_release(struct device *classdev)
|
||||
{
|
||||
struct internal_container *ic
|
||||
= container_of(classdev, struct internal_container, classdev);
|
||||
struct device *dev = classdev->dev;
|
||||
struct device *dev = classdev->parent;
|
||||
|
||||
kfree(ic);
|
||||
put_device(dev);
|
||||
@@ -129,12 +129,12 @@ static void attribute_container_release(struct class_device *classdev)
|
||||
* This function allocates storage for the class device(s) to be
|
||||
* attached to dev (one for each matching attribute_container). If no
|
||||
* fn is provided, the code will simply register the class device via
|
||||
* class_device_add. If a function is provided, it is expected to add
|
||||
* device_add. If a function is provided, it is expected to add
|
||||
* the class device at the appropriate time. One of the things that
|
||||
* might be necessary is to allocate and initialise the classdev and
|
||||
* then add it a later time. To do this, call this routine for
|
||||
* allocation and initialisation and then use
|
||||
* attribute_container_device_trigger() to call class_device_add() on
|
||||
* attribute_container_device_trigger() to call device_add() on
|
||||
* it. Note: after this, the class device contains a reference to dev
|
||||
* which is not relinquished until the release of the classdev.
|
||||
*/
|
||||
@@ -142,7 +142,7 @@ void
|
||||
attribute_container_add_device(struct device *dev,
|
||||
int (*fn)(struct attribute_container *,
|
||||
struct device *,
|
||||
struct class_device *))
|
||||
struct device *))
|
||||
{
|
||||
struct attribute_container *cont;
|
||||
|
||||
@@ -163,11 +163,11 @@ attribute_container_add_device(struct device *dev,
|
||||
}
|
||||
|
||||
ic->cont = cont;
|
||||
class_device_initialize(&ic->classdev);
|
||||
ic->classdev.dev = get_device(dev);
|
||||
device_initialize(&ic->classdev);
|
||||
ic->classdev.parent = get_device(dev);
|
||||
ic->classdev.class = cont->class;
|
||||
cont->class->release = attribute_container_release;
|
||||
strcpy(ic->classdev.class_id, dev->bus_id);
|
||||
cont->class->dev_release = attribute_container_release;
|
||||
strcpy(ic->classdev.bus_id, dev->bus_id);
|
||||
if (fn)
|
||||
fn(cont, dev, &ic->classdev);
|
||||
else
|
||||
@@ -195,20 +195,19 @@ attribute_container_add_device(struct device *dev,
|
||||
* @fn: A function to call to remove the device
|
||||
*
|
||||
* This routine triggers device removal. If fn is NULL, then it is
|
||||
* simply done via class_device_unregister (note that if something
|
||||
* simply done via device_unregister (note that if something
|
||||
* still has a reference to the classdev, then the memory occupied
|
||||
* will not be freed until the classdev is released). If you want a
|
||||
* two phase release: remove from visibility and then delete the
|
||||
* device, then you should use this routine with a fn that calls
|
||||
* class_device_del() and then use
|
||||
* attribute_container_device_trigger() to do the final put on the
|
||||
* classdev.
|
||||
* device_del() and then use attribute_container_device_trigger()
|
||||
* to do the final put on the classdev.
|
||||
*/
|
||||
void
|
||||
attribute_container_remove_device(struct device *dev,
|
||||
void (*fn)(struct attribute_container *,
|
||||
struct device *,
|
||||
struct class_device *))
|
||||
struct device *))
|
||||
{
|
||||
struct attribute_container *cont;
|
||||
|
||||
@@ -224,14 +223,14 @@ attribute_container_remove_device(struct device *dev,
|
||||
continue;
|
||||
|
||||
klist_for_each_entry(ic, &cont->containers, node, &iter) {
|
||||
if (dev != ic->classdev.dev)
|
||||
if (dev != ic->classdev.parent)
|
||||
continue;
|
||||
klist_del(&ic->node);
|
||||
if (fn)
|
||||
fn(cont, dev, &ic->classdev);
|
||||
else {
|
||||
attribute_container_remove_attrs(&ic->classdev);
|
||||
class_device_unregister(&ic->classdev);
|
||||
device_unregister(&ic->classdev);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -252,7 +251,7 @@ void
|
||||
attribute_container_device_trigger(struct device *dev,
|
||||
int (*fn)(struct attribute_container *,
|
||||
struct device *,
|
||||
struct class_device *))
|
||||
struct device *))
|
||||
{
|
||||
struct attribute_container *cont;
|
||||
|
||||
@@ -270,7 +269,7 @@ attribute_container_device_trigger(struct device *dev,
|
||||
}
|
||||
|
||||
klist_for_each_entry(ic, &cont->containers, node, &iter) {
|
||||
if (dev == ic->classdev.dev)
|
||||
if (dev == ic->classdev.parent)
|
||||
fn(cont, dev, &ic->classdev);
|
||||
}
|
||||
}
|
||||
@@ -313,11 +312,11 @@ attribute_container_trigger(struct device *dev,
|
||||
* attributes listed in the container
|
||||
*/
|
||||
int
|
||||
attribute_container_add_attrs(struct class_device *classdev)
|
||||
attribute_container_add_attrs(struct device *classdev)
|
||||
{
|
||||
struct attribute_container *cont =
|
||||
attribute_container_classdev_to_container(classdev);
|
||||
struct class_device_attribute **attrs = cont->attrs;
|
||||
struct device_attribute **attrs = cont->attrs;
|
||||
int i, error;
|
||||
|
||||
BUG_ON(attrs && cont->grp);
|
||||
@@ -329,7 +328,7 @@ attribute_container_add_attrs(struct class_device *classdev)
|
||||
return sysfs_create_group(&classdev->kobj, cont->grp);
|
||||
|
||||
for (i = 0; attrs[i]; i++) {
|
||||
error = class_device_create_file(classdev, attrs[i]);
|
||||
error = device_create_file(classdev, attrs[i]);
|
||||
if (error)
|
||||
return error;
|
||||
}
|
||||
@@ -338,18 +337,18 @@ attribute_container_add_attrs(struct class_device *classdev)
|
||||
}
|
||||
|
||||
/**
|
||||
* attribute_container_add_class_device - same function as class_device_add
|
||||
* attribute_container_add_class_device - same function as device_add
|
||||
*
|
||||
* @classdev: the class device to add
|
||||
*
|
||||
* This performs essentially the same function as class_device_add except for
|
||||
* This performs essentially the same function as device_add except for
|
||||
* attribute containers, namely add the classdev to the system and then
|
||||
* create the attribute files
|
||||
*/
|
||||
int
|
||||
attribute_container_add_class_device(struct class_device *classdev)
|
||||
attribute_container_add_class_device(struct device *classdev)
|
||||
{
|
||||
int error = class_device_add(classdev);
|
||||
int error = device_add(classdev);
|
||||
if (error)
|
||||
return error;
|
||||
return attribute_container_add_attrs(classdev);
|
||||
@@ -364,7 +363,7 @@ attribute_container_add_class_device(struct class_device *classdev)
|
||||
int
|
||||
attribute_container_add_class_device_adapter(struct attribute_container *cont,
|
||||
struct device *dev,
|
||||
struct class_device *classdev)
|
||||
struct device *classdev)
|
||||
{
|
||||
return attribute_container_add_class_device(classdev);
|
||||
}
|
||||
@@ -376,11 +375,11 @@ attribute_container_add_class_device_adapter(struct attribute_container *cont,
|
||||
*
|
||||
*/
|
||||
void
|
||||
attribute_container_remove_attrs(struct class_device *classdev)
|
||||
attribute_container_remove_attrs(struct device *classdev)
|
||||
{
|
||||
struct attribute_container *cont =
|
||||
attribute_container_classdev_to_container(classdev);
|
||||
struct class_device_attribute **attrs = cont->attrs;
|
||||
struct device_attribute **attrs = cont->attrs;
|
||||
int i;
|
||||
|
||||
if (!attrs && !cont->grp)
|
||||
@@ -392,7 +391,7 @@ attribute_container_remove_attrs(struct class_device *classdev)
|
||||
}
|
||||
|
||||
for (i = 0; attrs[i]; i++)
|
||||
class_device_remove_file(classdev, attrs[i]);
|
||||
device_remove_file(classdev, attrs[i]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -401,13 +400,13 @@ attribute_container_remove_attrs(struct class_device *classdev)
|
||||
* @classdev: the class device
|
||||
*
|
||||
* This function simply removes all the attribute files and then calls
|
||||
* class_device_del.
|
||||
* device_del.
|
||||
*/
|
||||
void
|
||||
attribute_container_class_device_del(struct class_device *classdev)
|
||||
attribute_container_class_device_del(struct device *classdev)
|
||||
{
|
||||
attribute_container_remove_attrs(classdev);
|
||||
class_device_del(classdev);
|
||||
device_del(classdev);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -419,16 +418,16 @@ attribute_container_class_device_del(struct class_device *classdev)
|
||||
* Looks up the device in the container's list of class devices and returns
|
||||
* the corresponding class_device.
|
||||
*/
|
||||
struct class_device *
|
||||
struct device *
|
||||
attribute_container_find_class_device(struct attribute_container *cont,
|
||||
struct device *dev)
|
||||
{
|
||||
struct class_device *cdev = NULL;
|
||||
struct device *cdev = NULL;
|
||||
struct internal_container *ic;
|
||||
struct klist_iter iter;
|
||||
|
||||
klist_for_each_entry(ic, &cont->containers, node, &iter) {
|
||||
if (ic->classdev.dev == dev) {
|
||||
if (ic->classdev.parent == dev) {
|
||||
cdev = &ic->classdev;
|
||||
/* FIXME: must exit iterator then break */
|
||||
klist_iter_exit(&iter);
|
||||
|
||||
+6
-11
@@ -79,7 +79,7 @@ static void driver_release(struct kobject *kobj)
|
||||
{
|
||||
struct driver_private *drv_priv = to_driver(kobj);
|
||||
|
||||
pr_debug("driver: '%s': %s\n", kobject_name(kobj), __FUNCTION__);
|
||||
pr_debug("driver: '%s': %s\n", kobject_name(kobj), __func__);
|
||||
kfree(drv_priv);
|
||||
}
|
||||
|
||||
@@ -505,14 +505,11 @@ void bus_attach_device(struct device *dev)
|
||||
int ret = 0;
|
||||
|
||||
if (bus) {
|
||||
dev->is_registered = 1;
|
||||
if (bus->p->drivers_autoprobe)
|
||||
ret = device_attach(dev);
|
||||
WARN_ON(ret < 0);
|
||||
if (ret >= 0)
|
||||
klist_add_tail(&dev->knode_bus, &bus->p->klist_devices);
|
||||
else
|
||||
dev->is_registered = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,10 +530,8 @@ void bus_remove_device(struct device *dev)
|
||||
sysfs_remove_link(&dev->bus->p->devices_kset->kobj,
|
||||
dev->bus_id);
|
||||
device_remove_attrs(dev->bus, dev);
|
||||
if (dev->is_registered) {
|
||||
dev->is_registered = 0;
|
||||
klist_del(&dev->knode_bus);
|
||||
}
|
||||
klist_del(&dev->knode_bus);
|
||||
|
||||
pr_debug("bus: '%s': remove device %s\n",
|
||||
dev->bus->name, dev->bus_id);
|
||||
device_release_driver(dev);
|
||||
@@ -682,19 +677,19 @@ int bus_add_driver(struct device_driver *drv)
|
||||
error = driver_create_file(drv, &driver_attr_uevent);
|
||||
if (error) {
|
||||
printk(KERN_ERR "%s: uevent attr (%s) failed\n",
|
||||
__FUNCTION__, drv->name);
|
||||
__func__, drv->name);
|
||||
}
|
||||
error = driver_add_attrs(bus, drv);
|
||||
if (error) {
|
||||
/* How the hell do we get out of this pickle? Give up */
|
||||
printk(KERN_ERR "%s: driver_add_attrs(%s) failed\n",
|
||||
__FUNCTION__, drv->name);
|
||||
__func__, drv->name);
|
||||
}
|
||||
error = add_bind_files(drv);
|
||||
if (error) {
|
||||
/* Ditto */
|
||||
printk(KERN_ERR "%s: add_bind_files(%s) failed\n",
|
||||
__FUNCTION__, drv->name);
|
||||
__func__, drv->name);
|
||||
}
|
||||
|
||||
kobject_uevent(&priv->kobj, KOBJ_ADD);
|
||||
|
||||
@@ -175,13 +175,13 @@ void class_unregister(struct class *cls)
|
||||
|
||||
static void class_create_release(struct class *cls)
|
||||
{
|
||||
pr_debug("%s called for %s\n", __FUNCTION__, cls->name);
|
||||
pr_debug("%s called for %s\n", __func__, cls->name);
|
||||
kfree(cls);
|
||||
}
|
||||
|
||||
static void class_device_create_release(struct class_device *class_dev)
|
||||
{
|
||||
pr_debug("%s called for %s\n", __FUNCTION__, class_dev->class_id);
|
||||
pr_debug("%s called for %s\n", __func__, class_dev->class_id);
|
||||
kfree(class_dev);
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ static void class_device_create_release(struct class_device *class_dev)
|
||||
static int class_device_create_uevent(struct class_device *class_dev,
|
||||
struct kobj_uevent_env *env)
|
||||
{
|
||||
pr_debug("%s called for %s\n", __FUNCTION__, class_dev->class_id);
|
||||
pr_debug("%s called for %s\n", __func__, class_dev->class_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -415,7 +415,7 @@ static int class_uevent(struct kset *kset, struct kobject *kobj,
|
||||
struct device *dev = class_dev->dev;
|
||||
int retval = 0;
|
||||
|
||||
pr_debug("%s - name = %s\n", __FUNCTION__, class_dev->class_id);
|
||||
pr_debug("%s - name = %s\n", __func__, class_dev->class_id);
|
||||
|
||||
if (MAJOR(class_dev->devt)) {
|
||||
add_uevent_var(env, "MAJOR=%u", MAJOR(class_dev->devt));
|
||||
|
||||
+14
-44
@@ -207,7 +207,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
|
||||
retval = dev->bus->uevent(dev, env);
|
||||
if (retval)
|
||||
pr_debug("device: '%s': %s: bus uevent() returned %d\n",
|
||||
dev->bus_id, __FUNCTION__, retval);
|
||||
dev->bus_id, __func__, retval);
|
||||
}
|
||||
|
||||
/* have the class specific function add its stuff */
|
||||
@@ -216,7 +216,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
|
||||
if (retval)
|
||||
pr_debug("device: '%s': %s: class uevent() "
|
||||
"returned %d\n", dev->bus_id,
|
||||
__FUNCTION__, retval);
|
||||
__func__, retval);
|
||||
}
|
||||
|
||||
/* have the device type specific fuction add its stuff */
|
||||
@@ -225,7 +225,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
|
||||
if (retval)
|
||||
pr_debug("device: '%s': %s: dev_type uevent() "
|
||||
"returned %d\n", dev->bus_id,
|
||||
__FUNCTION__, retval);
|
||||
__func__, retval);
|
||||
}
|
||||
|
||||
return retval;
|
||||
@@ -782,7 +782,7 @@ int device_add(struct device *dev)
|
||||
goto Done;
|
||||
}
|
||||
|
||||
pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__);
|
||||
pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
|
||||
|
||||
parent = get_device(dev->parent);
|
||||
setup_parent(dev, parent);
|
||||
@@ -817,13 +817,12 @@ int device_add(struct device *dev)
|
||||
error = device_add_attrs(dev);
|
||||
if (error)
|
||||
goto AttrsError;
|
||||
error = dpm_sysfs_add(dev);
|
||||
if (error)
|
||||
goto PMError;
|
||||
device_pm_add(dev);
|
||||
error = bus_add_device(dev);
|
||||
if (error)
|
||||
goto BusError;
|
||||
error = device_pm_add(dev);
|
||||
if (error)
|
||||
goto PMError;
|
||||
kobject_uevent(&dev->kobj, KOBJ_ADD);
|
||||
bus_attach_device(dev);
|
||||
if (parent)
|
||||
@@ -843,9 +842,9 @@ int device_add(struct device *dev)
|
||||
Done:
|
||||
put_device(dev);
|
||||
return error;
|
||||
BusError:
|
||||
device_pm_remove(dev);
|
||||
PMError:
|
||||
bus_remove_device(dev);
|
||||
BusError:
|
||||
if (dev->bus)
|
||||
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
|
||||
BUS_NOTIFY_DEL_DEVICE, dev);
|
||||
@@ -981,7 +980,7 @@ void device_del(struct device *dev)
|
||||
*/
|
||||
void device_unregister(struct device *dev)
|
||||
{
|
||||
pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__);
|
||||
pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
|
||||
device_del(dev);
|
||||
put_device(dev);
|
||||
}
|
||||
@@ -1076,7 +1075,7 @@ EXPORT_SYMBOL_GPL(device_remove_file);
|
||||
|
||||
static void device_create_release(struct device *dev)
|
||||
{
|
||||
pr_debug("device: '%s': %s\n", dev->bus_id, __FUNCTION__);
|
||||
pr_debug("device: '%s': %s\n", dev->bus_id, __func__);
|
||||
kfree(dev);
|
||||
}
|
||||
|
||||
@@ -1164,35 +1163,6 @@ void device_destroy(struct class *class, dev_t devt)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(device_destroy);
|
||||
|
||||
#ifdef CONFIG_PM_SLEEP
|
||||
/**
|
||||
* destroy_suspended_device - asks the PM core to remove a suspended device
|
||||
* @class: pointer to the struct class that this device was registered with
|
||||
* @devt: the dev_t of the device that was previously registered
|
||||
*
|
||||
* This call notifies the PM core of the necessity to unregister a suspended
|
||||
* device created with a call to device_create() (devices cannot be
|
||||
* unregistered directly while suspended, since the PM core holds their
|
||||
* semaphores at that time).
|
||||
*
|
||||
* It can only be called within the scope of a system sleep transition. In
|
||||
* practice this means it has to be directly or indirectly invoked either by
|
||||
* a suspend or resume method, or by the PM core (e.g. via
|
||||
* disable_nonboot_cpus() or enable_nonboot_cpus()).
|
||||
*/
|
||||
void destroy_suspended_device(struct class *class, dev_t devt)
|
||||
{
|
||||
struct device *dev;
|
||||
|
||||
dev = class_find_device(class, &devt, __match_devt);
|
||||
if (dev) {
|
||||
device_pm_schedule_removal(dev);
|
||||
put_device(dev);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(destroy_suspended_device);
|
||||
#endif /* CONFIG_PM_SLEEP */
|
||||
|
||||
/**
|
||||
* device_rename - renames a device
|
||||
* @dev: the pointer to the struct device to be renamed
|
||||
@@ -1210,7 +1180,7 @@ int device_rename(struct device *dev, char *new_name)
|
||||
return -EINVAL;
|
||||
|
||||
pr_debug("device: '%s': %s: renaming to '%s'\n", dev->bus_id,
|
||||
__FUNCTION__, new_name);
|
||||
__func__, new_name);
|
||||
|
||||
#ifdef CONFIG_SYSFS_DEPRECATED
|
||||
if ((dev->class) && (dev->parent))
|
||||
@@ -1249,7 +1219,7 @@ int device_rename(struct device *dev, char *new_name)
|
||||
dev->bus_id);
|
||||
if (error) {
|
||||
dev_err(dev, "%s: sysfs_create_symlink failed (%d)\n",
|
||||
__FUNCTION__, error);
|
||||
__func__, error);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1325,7 +1295,7 @@ int device_move(struct device *dev, struct device *new_parent)
|
||||
new_parent_kobj = get_device_parent(dev, new_parent);
|
||||
|
||||
pr_debug("device: '%s': %s: moving to '%s'\n", dev->bus_id,
|
||||
__FUNCTION__, new_parent ? new_parent->bus_id : "<NULL>");
|
||||
__func__, new_parent ? new_parent->bus_id : "<NULL>");
|
||||
error = kobject_move(&dev->kobj, new_parent_kobj);
|
||||
if (error) {
|
||||
cleanup_glue_dir(dev, new_parent_kobj);
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ static ssize_t show_online(struct sys_device *dev, char *buf)
|
||||
return sprintf(buf, "%u\n", !!cpu_online(cpu->sysdev.id));
|
||||
}
|
||||
|
||||
static ssize_t store_online(struct sys_device *dev, const char *buf,
|
||||
static ssize_t __ref store_online(struct sys_device *dev, const char *buf,
|
||||
size_t count)
|
||||
{
|
||||
struct cpu *cpu = container_of(dev, struct cpu, sysdev);
|
||||
@@ -55,7 +55,7 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
|
||||
}
|
||||
static SYSDEV_ATTR(online, 0644, show_online, store_online);
|
||||
|
||||
static void __devinit register_cpu_control(struct cpu *cpu)
|
||||
static void __cpuinit register_cpu_control(struct cpu *cpu)
|
||||
{
|
||||
sysdev_create_file(&cpu->sysdev, &attr_online);
|
||||
}
|
||||
|
||||
+7
-7
@@ -30,12 +30,12 @@ static void driver_bound(struct device *dev)
|
||||
{
|
||||
if (klist_node_attached(&dev->knode_driver)) {
|
||||
printk(KERN_WARNING "%s: device %s already bound\n",
|
||||
__FUNCTION__, kobject_name(&dev->kobj));
|
||||
__func__, kobject_name(&dev->kobj));
|
||||
return;
|
||||
}
|
||||
|
||||
pr_debug("driver: '%s': %s: bound to device '%s'\n", dev->bus_id,
|
||||
__FUNCTION__, dev->driver->name);
|
||||
__func__, dev->driver->name);
|
||||
|
||||
if (dev->bus)
|
||||
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
|
||||
@@ -104,13 +104,13 @@ static int really_probe(struct device *dev, struct device_driver *drv)
|
||||
|
||||
atomic_inc(&probe_count);
|
||||
pr_debug("bus: '%s': %s: probing driver %s with device %s\n",
|
||||
drv->bus->name, __FUNCTION__, drv->name, dev->bus_id);
|
||||
drv->bus->name, __func__, drv->name, dev->bus_id);
|
||||
WARN_ON(!list_empty(&dev->devres_head));
|
||||
|
||||
dev->driver = drv;
|
||||
if (driver_sysfs_add(dev)) {
|
||||
printk(KERN_ERR "%s: driver_sysfs_add(%s) failed\n",
|
||||
__FUNCTION__, dev->bus_id);
|
||||
__func__, dev->bus_id);
|
||||
goto probe_failed;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
|
||||
driver_bound(dev);
|
||||
ret = 1;
|
||||
pr_debug("bus: '%s': %s: bound device %s to driver %s\n",
|
||||
drv->bus->name, __FUNCTION__, dev->bus_id, drv->name);
|
||||
drv->bus->name, __func__, dev->bus_id, drv->name);
|
||||
goto done;
|
||||
|
||||
probe_failed:
|
||||
@@ -160,7 +160,7 @@ done:
|
||||
*/
|
||||
int driver_probe_done(void)
|
||||
{
|
||||
pr_debug("%s: probe_count = %d\n", __FUNCTION__,
|
||||
pr_debug("%s: probe_count = %d\n", __func__,
|
||||
atomic_read(&probe_count));
|
||||
if (atomic_read(&probe_count))
|
||||
return -EBUSY;
|
||||
@@ -194,7 +194,7 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)
|
||||
goto done;
|
||||
|
||||
pr_debug("bus: '%s': %s: matched device %s with driver %s\n",
|
||||
drv->bus->name, __FUNCTION__, dev->bus_id, drv->name);
|
||||
drv->bus->name, __func__, dev->bus_id, drv->name);
|
||||
|
||||
ret = really_probe(dev, drv);
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ static ssize_t firmware_loading_store(struct device *dev,
|
||||
}
|
||||
/* fallthrough */
|
||||
default:
|
||||
printk(KERN_ERR "%s: unexpected value (%d)\n", __FUNCTION__,
|
||||
printk(KERN_ERR "%s: unexpected value (%d)\n", __func__,
|
||||
loading);
|
||||
/* fallthrough */
|
||||
case -1:
|
||||
@@ -209,7 +209,7 @@ fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size)
|
||||
new_size = ALIGN(min_size, PAGE_SIZE);
|
||||
new_data = vmalloc(new_size);
|
||||
if (!new_data) {
|
||||
printk(KERN_ERR "%s: unable to alloc buffer\n", __FUNCTION__);
|
||||
printk(KERN_ERR "%s: unable to alloc buffer\n", __func__);
|
||||
/* Make sure that we don't keep incomplete data */
|
||||
fw_load_abort(fw_priv);
|
||||
return -ENOMEM;
|
||||
@@ -307,7 +307,7 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
|
||||
*dev_p = NULL;
|
||||
|
||||
if (!fw_priv || !f_dev) {
|
||||
printk(KERN_ERR "%s: kmalloc failed\n", __FUNCTION__);
|
||||
printk(KERN_ERR "%s: kmalloc failed\n", __func__);
|
||||
retval = -ENOMEM;
|
||||
goto error_kfree;
|
||||
}
|
||||
@@ -328,7 +328,7 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
|
||||
retval = device_register(f_dev);
|
||||
if (retval) {
|
||||
printk(KERN_ERR "%s: device_register failed\n",
|
||||
__FUNCTION__);
|
||||
__func__);
|
||||
goto error_kfree;
|
||||
}
|
||||
*dev_p = f_dev;
|
||||
@@ -362,14 +362,14 @@ static int fw_setup_device(struct firmware *fw, struct device **dev_p,
|
||||
retval = sysfs_create_bin_file(&f_dev->kobj, &fw_priv->attr_data);
|
||||
if (retval) {
|
||||
printk(KERN_ERR "%s: sysfs_create_bin_file failed\n",
|
||||
__FUNCTION__);
|
||||
__func__);
|
||||
goto error_unreg;
|
||||
}
|
||||
|
||||
retval = device_create_file(f_dev, &dev_attr_loading);
|
||||
if (retval) {
|
||||
printk(KERN_ERR "%s: device_create_file failed\n",
|
||||
__FUNCTION__);
|
||||
__func__);
|
||||
goto error_unreg;
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
|
||||
*firmware_p = firmware = kzalloc(sizeof(*firmware), GFP_KERNEL);
|
||||
if (!firmware) {
|
||||
printk(KERN_ERR "%s: kmalloc(struct firmware) failed\n",
|
||||
__FUNCTION__);
|
||||
__func__);
|
||||
retval = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
@@ -570,13 +570,13 @@ firmware_class_init(void)
|
||||
int error;
|
||||
error = class_register(&firmware_class);
|
||||
if (error) {
|
||||
printk(KERN_ERR "%s: class_register failed\n", __FUNCTION__);
|
||||
printk(KERN_ERR "%s: class_register failed\n", __func__);
|
||||
return error;
|
||||
}
|
||||
error = class_create_file(&firmware_class, &class_attr_timeout);
|
||||
if (error) {
|
||||
printk(KERN_ERR "%s: class_create_file failed\n",
|
||||
__FUNCTION__);
|
||||
__func__);
|
||||
class_unregister(&firmware_class);
|
||||
}
|
||||
return error;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user