Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188815
b: refs/heads/master
c: 17cf444
h: refs/heads/master
i:
  188813: acdb343
  188811: 3a869fe
  188807: 9c24f2b
  188799: 349039b
v: v3
  • Loading branch information
Jeff Garzik authored and Jeff Garzik committed Mar 19, 2010
1 parent ade9682 commit b3be8b0
Show file tree
Hide file tree
Showing 128 changed files with 349 additions and 28,890 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8dba8f949492cf2ffb32c1c2fbfe12c3f53b1866
refs/heads/master: 17cf4442497cb2551eae1dedee638515db47c23e
2 changes: 1 addition & 1 deletion trunk/Documentation/ABI/testing/sysfs-bus-usb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Description:
match the driver to the device. For example:
# echo "046d c315" > /sys/bus/usb/drivers/foo/remove_id

What: /sys/bus/usb/device/.../avoid_reset_quirk
What: /sys/bus/usb/device/.../avoid_reset
Date: December 2009
Contact: Oliver Neukum <oliver@neukum.org>
Description:
Expand Down
139 changes: 0 additions & 139 deletions trunk/Documentation/filesystems/ceph.txt

This file was deleted.

1 change: 0 additions & 1 deletion trunk/Documentation/ioctl/ioctl-number.txt
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ Code Seq#(hex) Include File Comments
0x92 00-0F drivers/usb/mon/mon_bin.c
0x93 60-7F linux/auto_fs.h
0x94 all fs/btrfs/ioctl.h
0x97 00-7F fs/ceph/ioctl.h Ceph file system
0x99 00-0F 537-Addinboard driver
<mailto:buk@buks.ipn.de>
0xA0 all linux/sdp/sdp.h Industrial Device Project
Expand Down
60 changes: 20 additions & 40 deletions trunk/Documentation/kobject.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,56 +59,37 @@ nice to have in other objects. The C language does not allow for the
direct expression of inheritance, so other techniques - such as structure
embedding - must be used.

(As an aside, for those familiar with the kernel linked list implementation,
this is analogous as to how "list_head" structs are rarely useful on
their own, but are invariably found embedded in the larger objects of
interest.)
So, for example, the UIO code has a structure that defines the memory
region associated with a uio device:

So, for example, the UIO code in drivers/uio/uio.c has a structure that
defines the memory region associated with a uio device:

struct uio_map {
struct uio_mem {
struct kobject kobj;
struct uio_mem *mem;
};
unsigned long addr;
unsigned long size;
int memtype;
void __iomem *internal_addr;
};

If you have a struct uio_map structure, finding its embedded kobject is
If you have a struct uio_mem structure, finding its embedded kobject is
just a matter of using the kobj member. Code that works with kobjects will
often have the opposite problem, however: given a struct kobject pointer,
what is the pointer to the containing structure? You must avoid tricks
(such as assuming that the kobject is at the beginning of the structure)
and, instead, use the container_of() macro, found in <linux/kernel.h>:

container_of(pointer, type, member)

where:

* "pointer" is the pointer to the embedded kobject,
* "type" is the type of the containing structure, and
* "member" is the name of the structure field to which "pointer" points.

The return value from container_of() is a pointer to the corresponding
container type. So, for example, a pointer "kp" to a struct kobject
embedded *within* a struct uio_map could be converted to a pointer to the
*containing* uio_map structure with:

struct uio_map *u_map = container_of(kp, struct uio_map, kobj);

For convenience, programmers often define a simple macro for "back-casting"
kobject pointers to the containing type. Exactly this happens in the
earlier drivers/uio/uio.c, as you can see here:

struct uio_map {
struct kobject kobj;
struct uio_mem *mem;
};
container_of(pointer, type, member)

#define to_map(map) container_of(map, struct uio_map, kobj)
where pointer is the pointer to the embedded kobject, type is the type of
the containing structure, and member is the name of the structure field to
which pointer points. The return value from container_of() is a pointer to
the given type. So, for example, a pointer "kp" to a struct kobject
embedded within a struct uio_mem could be converted to a pointer to the
containing uio_mem structure with:

where the macro argument "map" is a pointer to the struct kobject in
question. That macro is subsequently invoked with:
struct uio_mem *u_mem = container_of(kp, struct uio_mem, kobj);

struct uio_map *map = to_map(kobj);
Programmers often define a simple macro for "back-casting" kobject pointers
to the containing type.


Initialization of kobjects
Expand Down Expand Up @@ -406,5 +387,4 @@ called, and the objects in the former circle release each other.
Example code to copy from

For a more complete example of using ksets and kobjects properly, see the
example programs samples/kobject/{kobject-example.c,kset-example.c},
which will be built as loadable modules if you select CONFIG_SAMPLE_KOBJECT.
sample/kobject/kset-example.c code.
9 changes: 0 additions & 9 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1441,15 +1441,6 @@ F: arch/powerpc/include/asm/spu*.h
F: arch/powerpc/oprofile/*cell*
F: arch/powerpc/platforms/cell/

CEPH DISTRIBUTED FILE SYSTEM CLIENT
M: Sage Weil <sage@newdream.net>
L: ceph-devel@lists.sourceforge.net
W: http://ceph.newdream.net/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
S: Supported
F: Documentation/filesystems/ceph.txt
F: fs/ceph

CERTIFIED WIRELESS USB (WUSB) SUBSYSTEM:
M: David Vrabel <david.vrabel@csr.com>
L: linux-usb@vger.kernel.org
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/base/class.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@ static void class_create_release(struct class *cls)
* This is used to create a struct class pointer that can then be used
* in calls to device_create().
*
* Returns &struct class pointer on success, or ERR_PTR() on error.
*
* Note, the pointer created here is to be destroyed when finished by
* making a call to class_destroy().
*/
Expand Down
6 changes: 0 additions & 6 deletions trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1345,8 +1345,6 @@ static void root_device_release(struct device *dev)
* 'module' symlink which points to the @owner directory
* in sysfs.
*
* Returns &struct device pointer on success, or ERR_PTR() on error.
*
* Note: You probably want to use root_device_register().
*/
struct device *__root_device_register(const char *name, struct module *owner)
Expand Down Expand Up @@ -1434,8 +1432,6 @@ static void device_create_release(struct device *dev)
* Any further sysfs files that might be required can be created using this
* pointer.
*
* Returns &struct device pointer on success, or ERR_PTR() on error.
*
* Note: the struct class passed to this function must have previously
* been created with a call to class_create().
*/
Expand Down Expand Up @@ -1496,8 +1492,6 @@ EXPORT_SYMBOL_GPL(device_create_vargs);
* Any further sysfs files that might be required can be created using this
* pointer.
*
* Returns &struct device pointer on success, or ERR_PTR() on error.
*
* Note: the struct class passed to this function must have previously
* been created with a call to class_create().
*/
Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/base/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,24 @@ void unregister_cpu(struct cpu *cpu)
}

#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
static ssize_t cpu_probe_store(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
const char *buf,
static ssize_t cpu_probe_store(struct sys_device *dev,
struct sysdev_attribute *attr,
const char *buf,
size_t count)
{
return arch_cpu_probe(buf, count);
}

static ssize_t cpu_release_store(struct sysdev_class *class,
struct sysdev_class_attribute *attr,
const char *buf,
static ssize_t cpu_release_store(struct sys_device *dev,
struct sysdev_attribute *attr,
const char *buf,
size_t count)
{
return arch_cpu_release(buf, count);
}

static SYSDEV_CLASS_ATTR(probe, S_IWUSR, NULL, cpu_probe_store);
static SYSDEV_CLASS_ATTR(release, S_IWUSR, NULL, cpu_release_store);
static SYSDEV_ATTR(probe, S_IWUSR, NULL, cpu_probe_store);
static SYSDEV_ATTR(release, S_IWUSR, NULL, cpu_release_store);
#endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */

#else /* ... !CONFIG_HOTPLUG_CPU */
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ firmware_timeout_show(struct class *class,
/**
* firmware_timeout_store - set number of seconds to wait for firmware
* @class: device class pointer
* @attr: device attribute pointer
* @buf: buffer to scan for timeout value
* @count: number of bytes in @buf
*
Expand Down Expand Up @@ -443,7 +442,6 @@ static int fw_setup_device(struct firmware *fw, struct device **dev_p,
fw_priv = dev_get_drvdata(f_dev);

fw_priv->fw = fw;
sysfs_bin_attr_init(&fw_priv->attr_data);
retval = sysfs_create_bin_file(&f_dev->kobj, &fw_priv->attr_data);
if (retval) {
dev_err(device, "%s: sysfs_create_bin_file failed\n", __func__);
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/base/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,8 @@ static ssize_t node_read_distance(struct sys_device * dev,
int len = 0;
int i;

/*
* buf is currently PAGE_SIZE in length and each node needs 4 chars
* at the most (distance + space or newline).
*/
BUILD_BUG_ON(MAX_NUMNODES * 4 > PAGE_SIZE);
/* buf currently PAGE_SIZE, need ~4 chars per node */
BUILD_BUG_ON(MAX_NUMNODES*4 > PAGE_SIZE/2);

for_each_online_node(i)
len += sprintf(buf + len, "%s%d", i ? " " : "", node_distance(nid, i));
Expand Down
Loading

0 comments on commit b3be8b0

Please sign in to comment.