* [GIT PATCH] driver core fixes for your 2.6-git tree
@ 2008-10-29 22:38 Greg KH
0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2008-10-29 22:38 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel
Here are 6 patches for your 2.6-git tree.
They contain:
- 4 documentation updates:
- ja_JP/HOWTO update
- stable_kernel_rules.txt update
- document the taint flags properly
- fix some function comments in drivers/base/sys.c that
were incorrect.
- bugfix for the dynamic_printk command line option
- bugfix for the sysdev code
All of these have been in the -next trees and the -mm releases for a
while now.
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/
The patches will be sent as a follow-on to this message to lkml for people
to see.
thanks,
greg k-h
------------
Documentation/ja_JP/HOWTO | 14 +++++++-------
Documentation/stable_kernel_rules.txt | 1 +
Documentation/sysctl/kernel.txt | 24 +++++++++++++++++-------
drivers/base/sys.c | 10 ++++++----
lib/dynamic_printk.c | 4 +++-
5 files changed, 34 insertions(+), 19 deletions(-)
---------------
Andi Kleen (1):
sysfs: Fix return values for sysdev_store_{ulong,int}
Greg Kroah-Hartman (1):
Document kernel taint flags properly
Jason Baron (1):
Driver core: fix 'dynamic_debug' cmd line parameter
Josh Boyer (1):
Update stable tree documentation
Qinghuang Feng (1):
driver core: drivers/base/sys.c: update comments
Tsugikazu Shibata (1):
HOWTO: Sync patch for jp_JP/HOWTO
^ permalink raw reply [flat|nested] 9+ messages in thread
* [GIT PATCH] driver core fixes for your 2.6-git tree
@ 2008-12-17 19:27 Greg KH
0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2008-12-17 19:27 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel
Here are 4 patches for your 2.6-git tree.
They contain:
- licensing fix for the xilinx_hwicap drivers (signed off by the
original authors)
- 2 dynamic debug printk fixes
- staging Kconfig fix
All of these have been in the -next trees and the -mm releases for a
while now.
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/
The patches will be sent as a follow-on to this message to lkml for people
to see.
thanks,
greg k-h
------------
drivers/char/xilinx_hwicap/buffer_icap.c | 3 ---
drivers/char/xilinx_hwicap/buffer_icap.h | 3 ---
drivers/char/xilinx_hwicap/fifo_icap.c | 3 ---
drivers/char/xilinx_hwicap/fifo_icap.h | 3 ---
drivers/char/xilinx_hwicap/xilinx_hwicap.c | 3 ---
drivers/char/xilinx_hwicap/xilinx_hwicap.h | 3 ---
drivers/staging/Kconfig | 3 +++
lib/dynamic_printk.c | 6 +++---
8 files changed, 6 insertions(+), 21 deletions(-)
---------------
Dmitry Baryshkov (1):
STAGING: Move staging drivers back to staging-specific menu
Greg Kroah-Hartman (1):
xilinx_hwicap: remove improper wording in license statement
Johann Felix Soden (1):
driver core: fix using 'ret' variable in unregister_dynamic_debug_module
Marcel Holtmann (1):
driver core: add newlines to debugging enabled/disabled messages
^ permalink raw reply [flat|nested] 9+ messages in thread
* [GIT PATCH] driver core fixes for your 2.6-git tree
@ 2009-01-09 23:20 Greg KH
2009-01-09 23:20 ` [PATCH 1/4] Revert "driver core: move knode_bus into private structure" Greg Kroah-Hartman
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Greg KH @ 2009-01-09 23:20 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton
Cc: linux-kernel, Stefan Richter, Alan Cox, Kay Sievers
Here are 4 reverts of patches that were previously pulled into your git
tree. They revert the ability for the driver core to have a private
area in struct device.
Thanks to Stefan Richter for pointing out the problems with the current
implementation, and for Alan Cox persuading me to rework the whole
thing, which I will do for the 2.6.30 release.
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/
The patches will be sent as a follow-on to this message to lkml for people
to see.
thanks,
greg k-h
------------
drivers/base/base.h | 26 --------------------------
drivers/base/bus.c | 40 +++++++++++++---------------------------
drivers/base/core.c | 45 +++++++++++++--------------------------------
drivers/base/dd.c | 13 +++++--------
drivers/base/driver.c | 13 +++----------
include/linux/device.h | 7 ++++---
6 files changed, 38 insertions(+), 106 deletions(-)
---------------
Greg Kroah-Hartman (4):
Revert "driver core: move knode_bus into private structure"
Revert "driver core: move knode_driver into private structure"
Revert "driver core: move klist_children into private structure"
Revert "driver core: create a private portion of struct device"
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/4] Revert "driver core: move knode_bus into private structure"
2009-01-09 23:20 [GIT PATCH] driver core fixes for your 2.6-git tree Greg KH
@ 2009-01-09 23:20 ` Greg Kroah-Hartman
2009-01-09 23:20 ` [PATCH 2/4] Revert "driver core: move knode_driver " Greg Kroah-Hartman
` (2 subsequent siblings)
3 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2009-01-09 23:20 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, Alan Cox, Kay Sievers
This reverts commit b9daa99ee533578e3f88231e7a16784dcb44ec42.
Turns out that device_initialize shouldn't fail silently.
This series needs to be reworked in order to get into proper
shape.
Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/base.h | 4 ----
drivers/base/bus.c | 40 +++++++++++++---------------------------
include/linux/device.h | 1 +
3 files changed, 14 insertions(+), 31 deletions(-)
diff --git a/drivers/base/base.h b/drivers/base/base.h
index b676f8f..8af0bb2 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -69,7 +69,6 @@ struct class_private {
* @klist_children - klist containing all children of this device
* @knode_parent - node in sibling list
* @knode_driver - node in driver list
- * @knode_bus - node in bus list
* @device - pointer back to the struct class that this structure is
* associated with.
*
@@ -79,15 +78,12 @@ struct device_private {
struct klist klist_children;
struct klist_node knode_parent;
struct klist_node knode_driver;
- struct klist_node knode_bus;
struct device *device;
};
#define to_device_private_parent(obj) \
container_of(obj, struct device_private, knode_parent)
#define to_device_private_driver(obj) \
container_of(obj, struct device_private, knode_driver)
-#define to_device_private_bus(obj) \
- container_of(obj, struct device_private, knode_bus)
/* initialisation functions */
extern int devices_init(void);
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 0f0a504..83f32b8 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -253,14 +253,7 @@ static ssize_t store_drivers_probe(struct bus_type *bus,
static struct device *next_device(struct klist_iter *i)
{
struct klist_node *n = klist_next(i);
- struct device *dev = NULL;
- struct device_private *dev_prv;
-
- if (n) {
- dev_prv = to_device_private_bus(n);
- dev = dev_prv->device;
- }
- return dev;
+ return n ? container_of(n, struct device, knode_bus) : NULL;
}
/**
@@ -293,7 +286,7 @@ int bus_for_each_dev(struct bus_type *bus, struct device *start,
return -EINVAL;
klist_iter_init_node(&bus->p->klist_devices, &i,
- (start ? &start->p->knode_bus : NULL));
+ (start ? &start->knode_bus : NULL));
while ((dev = next_device(&i)) && !error)
error = fn(dev, data);
klist_iter_exit(&i);
@@ -327,7 +320,7 @@ struct device *bus_find_device(struct bus_type *bus,
return NULL;
klist_iter_init_node(&bus->p->klist_devices, &i,
- (start ? &start->p->knode_bus : NULL));
+ (start ? &start->knode_bus : NULL));
while ((dev = next_device(&i)))
if (match(dev, data) && get_device(dev))
break;
@@ -514,8 +507,7 @@ void bus_attach_device(struct device *dev)
ret = device_attach(dev);
WARN_ON(ret < 0);
if (ret >= 0)
- klist_add_tail(&dev->p->knode_bus,
- &bus->p->klist_devices);
+ klist_add_tail(&dev->knode_bus, &bus->p->klist_devices);
}
}
@@ -536,8 +528,8 @@ void bus_remove_device(struct device *dev)
sysfs_remove_link(&dev->bus->p->devices_kset->kobj,
dev_name(dev));
device_remove_attrs(dev->bus, dev);
- if (klist_node_attached(&dev->p->knode_bus))
- klist_del(&dev->p->knode_bus);
+ if (klist_node_attached(&dev->knode_bus))
+ klist_del(&dev->knode_bus);
pr_debug("bus: '%s': remove device %s\n",
dev->bus->name, dev_name(dev));
@@ -839,16 +831,14 @@ static void bus_remove_attrs(struct bus_type *bus)
static void klist_devices_get(struct klist_node *n)
{
- struct device_private *dev_prv = to_device_private_bus(n);
- struct device *dev = dev_prv->device;
+ struct device *dev = container_of(n, struct device, knode_bus);
get_device(dev);
}
static void klist_devices_put(struct klist_node *n)
{
- struct device_private *dev_prv = to_device_private_bus(n);
- struct device *dev = dev_prv->device;
+ struct device *dev = container_of(n, struct device, knode_bus);
put_device(dev);
}
@@ -1003,20 +993,18 @@ static void device_insertion_sort_klist(struct device *a, struct list_head *list
{
struct list_head *pos;
struct klist_node *n;
- struct device_private *dev_prv;
struct device *b;
list_for_each(pos, list) {
n = container_of(pos, struct klist_node, n_node);
- dev_prv = to_device_private_bus(n);
- b = dev_prv->device;
+ b = container_of(n, struct device, knode_bus);
if (compare(a, b) <= 0) {
- list_move_tail(&a->p->knode_bus.n_node,
- &b->p->knode_bus.n_node);
+ list_move_tail(&a->knode_bus.n_node,
+ &b->knode_bus.n_node);
return;
}
}
- list_move_tail(&a->p->knode_bus.n_node, list);
+ list_move_tail(&a->knode_bus.n_node, list);
}
void bus_sort_breadthfirst(struct bus_type *bus,
@@ -1026,7 +1014,6 @@ void bus_sort_breadthfirst(struct bus_type *bus,
LIST_HEAD(sorted_devices);
struct list_head *pos, *tmp;
struct klist_node *n;
- struct device_private *dev_prv;
struct device *dev;
struct klist *device_klist;
@@ -1035,8 +1022,7 @@ void bus_sort_breadthfirst(struct bus_type *bus,
spin_lock(&device_klist->k_lock);
list_for_each_safe(pos, tmp, &device_klist->k_list) {
n = container_of(pos, struct klist_node, n_node);
- dev_prv = to_device_private_bus(n);
- dev = dev_prv->device;
+ dev = container_of(n, struct device, knode_bus);
device_insertion_sort_klist(dev, &sorted_devices, compare);
}
list_splice(&sorted_devices, &device_klist->k_list);
diff --git a/include/linux/device.h b/include/linux/device.h
index 7d9da4b..8987f47 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -366,6 +366,7 @@ struct device_dma_parameters {
};
struct device {
+ struct klist_node knode_bus;
struct device *parent;
struct device_private *p;
--
1.6.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/4] Revert "driver core: move knode_driver into private structure"
2009-01-09 23:20 [GIT PATCH] driver core fixes for your 2.6-git tree Greg KH
2009-01-09 23:20 ` [PATCH 1/4] Revert "driver core: move knode_bus into private structure" Greg Kroah-Hartman
@ 2009-01-09 23:20 ` Greg Kroah-Hartman
2009-01-09 23:20 ` [PATCH 3/4] Revert "driver core: move klist_children " Greg Kroah-Hartman
2009-01-09 23:20 ` [PATCH 4/4] Revert "driver core: create a private portion of struct device" Greg Kroah-Hartman
3 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2009-01-09 23:20 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, Alan Cox, Kay Sievers
This reverts commit 93e746db183b3bdbbda67900f79b5835f9cb388f.
Turns out that device_initialize shouldn't fail silently.
This series needs to be reworked in order to get into proper
shape.
Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/base.h | 4 ----
drivers/base/dd.c | 13 +++++--------
drivers/base/driver.c | 13 +++----------
include/linux/device.h | 1 +
4 files changed, 9 insertions(+), 22 deletions(-)
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 8af0bb2..f5cf31c 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -68,7 +68,6 @@ struct class_private {
*
* @klist_children - klist containing all children of this device
* @knode_parent - node in sibling list
- * @knode_driver - node in driver list
* @device - pointer back to the struct class that this structure is
* associated with.
*
@@ -77,13 +76,10 @@ struct class_private {
struct device_private {
struct klist klist_children;
struct klist_node knode_parent;
- struct klist_node knode_driver;
struct device *device;
};
#define to_device_private_parent(obj) \
container_of(obj, struct device_private, knode_parent)
-#define to_device_private_driver(obj) \
- container_of(obj, struct device_private, knode_driver)
/* initialisation functions */
extern int devices_init(void);
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 6fdaf76..315bed8 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -28,7 +28,7 @@
static void driver_bound(struct device *dev)
{
- if (klist_node_attached(&dev->p->knode_driver)) {
+ if (klist_node_attached(&dev->knode_driver)) {
printk(KERN_WARNING "%s: device %s already bound\n",
__func__, kobject_name(&dev->kobj));
return;
@@ -41,7 +41,7 @@ static void driver_bound(struct device *dev)
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
BUS_NOTIFY_BOUND_DRIVER, dev);
- klist_add_tail(&dev->p->knode_driver, &dev->driver->p->klist_devices);
+ klist_add_tail(&dev->knode_driver, &dev->driver->p->klist_devices);
}
static int driver_sysfs_add(struct device *dev)
@@ -310,7 +310,7 @@ static void __device_release_driver(struct device *dev)
drv->remove(dev);
devres_release_all(dev);
dev->driver = NULL;
- klist_remove(&dev->p->knode_driver);
+ klist_remove(&dev->knode_driver);
}
}
@@ -340,7 +340,6 @@ EXPORT_SYMBOL_GPL(device_release_driver);
*/
void driver_detach(struct device_driver *drv)
{
- struct device_private *dev_prv;
struct device *dev;
for (;;) {
@@ -349,10 +348,8 @@ void driver_detach(struct device_driver *drv)
spin_unlock(&drv->p->klist_devices.k_lock);
break;
}
- dev_prv = list_entry(drv->p->klist_devices.k_list.prev,
- struct device_private,
- knode_driver.n_node);
- dev = dev_prv->device;
+ dev = list_entry(drv->p->klist_devices.k_list.prev,
+ struct device, knode_driver.n_node);
get_device(dev);
spin_unlock(&drv->p->klist_devices.k_lock);
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index b76cc69..1e2bda7 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -19,14 +19,7 @@
static struct device *next_device(struct klist_iter *i)
{
struct klist_node *n = klist_next(i);
- struct device *dev = NULL;
- struct device_private *dev_prv;
-
- if (n) {
- dev_prv = to_device_private_driver(n);
- dev = dev_prv->device;
- }
- return dev;
+ return n ? container_of(n, struct device, knode_driver) : NULL;
}
/**
@@ -49,7 +42,7 @@ int driver_for_each_device(struct device_driver *drv, struct device *start,
return -EINVAL;
klist_iter_init_node(&drv->p->klist_devices, &i,
- start ? &start->p->knode_driver : NULL);
+ start ? &start->knode_driver : NULL);
while ((dev = next_device(&i)) && !error)
error = fn(dev, data);
klist_iter_exit(&i);
@@ -83,7 +76,7 @@ struct device *driver_find_device(struct device_driver *drv,
return NULL;
klist_iter_init_node(&drv->p->klist_devices, &i,
- (start ? &start->p->knode_driver : NULL));
+ (start ? &start->knode_driver : NULL));
while ((dev = next_device(&i)))
if (match(dev, data) && get_device(dev))
break;
diff --git a/include/linux/device.h b/include/linux/device.h
index 8987f47..c66ceb1 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -366,6 +366,7 @@ struct device_dma_parameters {
};
struct device {
+ struct klist_node knode_driver;
struct klist_node knode_bus;
struct device *parent;
--
1.6.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/4] Revert "driver core: move klist_children into private structure"
2009-01-09 23:20 [GIT PATCH] driver core fixes for your 2.6-git tree Greg KH
2009-01-09 23:20 ` [PATCH 1/4] Revert "driver core: move knode_bus into private structure" Greg Kroah-Hartman
2009-01-09 23:20 ` [PATCH 2/4] Revert "driver core: move knode_driver " Greg Kroah-Hartman
@ 2009-01-09 23:20 ` Greg Kroah-Hartman
2009-01-09 23:20 ` [PATCH 4/4] Revert "driver core: create a private portion of struct device" Greg Kroah-Hartman
3 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2009-01-09 23:20 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, Alan Cox, Kay Sievers
This reverts commit 11c3b5c3e08f4d855cbef52883c266b9ab9df879.
Turns out that device_initialize shouldn't fail silently.
This series needs to be reworked in order to get into proper
shape.
Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/base.h | 6 ------
drivers/base/core.c | 37 +++++++++++++------------------------
include/linux/device.h | 2 ++
3 files changed, 15 insertions(+), 30 deletions(-)
diff --git a/drivers/base/base.h b/drivers/base/base.h
index f5cf31c..6b20809 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -66,20 +66,14 @@ struct class_private {
/**
* struct device_private - structure to hold the private to the driver core portions of the device structure.
*
- * @klist_children - klist containing all children of this device
- * @knode_parent - node in sibling list
* @device - pointer back to the struct class that this structure is
* associated with.
*
* Nothing outside of the driver core should ever touch these fields.
*/
struct device_private {
- struct klist klist_children;
- struct klist_node knode_parent;
struct device *device;
};
-#define to_device_private_parent(obj) \
- container_of(obj, struct device_private, knode_parent)
/* initialisation functions */
extern int devices_init(void);
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 61df508..5c2acf7 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -509,16 +509,14 @@ EXPORT_SYMBOL_GPL(device_schedule_callback_owner);
static void klist_children_get(struct klist_node *n)
{
- struct device_private *p = to_device_private_parent(n);
- struct device *dev = p->device;
+ struct device *dev = container_of(n, struct device, knode_parent);
get_device(dev);
}
static void klist_children_put(struct klist_node *n)
{
- struct device_private *p = to_device_private_parent(n);
- struct device *dev = p->device;
+ struct device *dev = container_of(n, struct device, knode_parent);
put_device(dev);
}
@@ -548,7 +546,7 @@ void device_initialize(struct device *dev)
dev->p->device = dev;
dev->kobj.kset = devices_kset;
kobject_init(&dev->kobj, &device_ktype);
- klist_init(&dev->p->klist_children, klist_children_get,
+ klist_init(&dev->klist_children, klist_children_get,
klist_children_put);
INIT_LIST_HEAD(&dev->dma_pools);
init_MUTEX(&dev->sem);
@@ -932,8 +930,7 @@ int device_add(struct device *dev)
kobject_uevent(&dev->kobj, KOBJ_ADD);
bus_attach_device(dev);
if (parent)
- klist_add_tail(&dev->p->knode_parent,
- &parent->p->klist_children);
+ klist_add_tail(&dev->knode_parent, &parent->klist_children);
if (dev->class) {
mutex_lock(&dev->class->p->class_mutex);
@@ -1047,7 +1044,7 @@ void device_del(struct device *dev)
device_pm_remove(dev);
dpm_sysfs_remove(dev);
if (parent)
- klist_del(&dev->p->knode_parent);
+ klist_del(&dev->knode_parent);
if (MAJOR(dev->devt)) {
device_remove_sys_dev_entry(dev);
device_remove_file(dev, &devt_attr);
@@ -1108,14 +1105,7 @@ void device_unregister(struct device *dev)
static struct device *next_device(struct klist_iter *i)
{
struct klist_node *n = klist_next(i);
- struct device *dev = NULL;
- struct device_private *p;
-
- if (n) {
- p = to_device_private_parent(n);
- dev = p->device;
- }
- return dev;
+ return n ? container_of(n, struct device, knode_parent) : NULL;
}
/**
@@ -1137,7 +1127,7 @@ int device_for_each_child(struct device *parent, void *data,
struct device *child;
int error = 0;
- klist_iter_init(&parent->p->klist_children, &i);
+ klist_iter_init(&parent->klist_children, &i);
while ((child = next_device(&i)) && !error)
error = fn(child, data);
klist_iter_exit(&i);
@@ -1168,7 +1158,7 @@ struct device *device_find_child(struct device *parent, void *data,
if (!parent)
return NULL;
- klist_iter_init(&parent->p->klist_children, &i);
+ klist_iter_init(&parent->klist_children, &i);
while ((child = next_device(&i)))
if (match(child, data) && get_device(child))
break;
@@ -1582,10 +1572,9 @@ int device_move(struct device *dev, struct device *new_parent)
old_parent = dev->parent;
dev->parent = new_parent;
if (old_parent)
- klist_remove(&dev->p->knode_parent);
+ klist_remove(&dev->knode_parent);
if (new_parent) {
- klist_add_tail(&dev->p->knode_parent,
- &new_parent->p->klist_children);
+ klist_add_tail(&dev->knode_parent, &new_parent->klist_children);
set_dev_node(dev, dev_to_node(new_parent));
}
@@ -1597,11 +1586,11 @@ int device_move(struct device *dev, struct device *new_parent)
device_move_class_links(dev, new_parent, old_parent);
if (!kobject_move(&dev->kobj, &old_parent->kobj)) {
if (new_parent)
- klist_remove(&dev->p->knode_parent);
+ klist_remove(&dev->knode_parent);
dev->parent = old_parent;
if (old_parent) {
- klist_add_tail(&dev->p->knode_parent,
- &old_parent->p->klist_children);
+ klist_add_tail(&dev->knode_parent,
+ &old_parent->klist_children);
set_dev_node(dev, dev_to_node(old_parent));
}
}
diff --git a/include/linux/device.h b/include/linux/device.h
index c66ceb1..2975351 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -366,6 +366,8 @@ struct device_dma_parameters {
};
struct device {
+ struct klist klist_children;
+ struct klist_node knode_parent; /* node in sibling list */
struct klist_node knode_driver;
struct klist_node knode_bus;
struct device *parent;
--
1.6.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/4] Revert "driver core: create a private portion of struct device"
2009-01-09 23:20 [GIT PATCH] driver core fixes for your 2.6-git tree Greg KH
` (2 preceding siblings ...)
2009-01-09 23:20 ` [PATCH 3/4] Revert "driver core: move klist_children " Greg Kroah-Hartman
@ 2009-01-09 23:20 ` Greg Kroah-Hartman
3 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2009-01-09 23:20 UTC (permalink / raw)
To: linux-kernel; +Cc: Greg Kroah-Hartman, Alan Cox, Kay Sievers
This reverts commit 2831fe6f9cc4e16c103504ee09a47a084297c0f3.
Turns out that device_initialize shouldn't fail silently.
This series needs to be reworked in order to get into proper
shape.
Reported-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/base.h | 12 ------------
drivers/base/core.c | 8 --------
include/linux/device.h | 3 ---
3 files changed, 0 insertions(+), 23 deletions(-)
diff --git a/drivers/base/base.h b/drivers/base/base.h
index 6b20809..0a5f055 100644
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -63,18 +63,6 @@ struct class_private {
#define to_class(obj) \
container_of(obj, struct class_private, class_subsys.kobj)
-/**
- * struct device_private - structure to hold the private to the driver core portions of the device structure.
- *
- * @device - pointer back to the struct class that this structure is
- * associated with.
- *
- * Nothing outside of the driver core should ever touch these fields.
- */
-struct device_private {
- struct device *device;
-};
-
/* initialisation functions */
extern int devices_init(void);
extern int buses_init(void);
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 5c2acf7..8079afc 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -109,7 +109,6 @@ static struct sysfs_ops dev_sysfs_ops = {
static void device_release(struct kobject *kobj)
{
struct device *dev = to_dev(kobj);
- struct device_private *p = dev->p;
if (dev->release)
dev->release(dev);
@@ -121,7 +120,6 @@ static void device_release(struct kobject *kobj)
WARN(1, KERN_ERR "Device '%s' does not have a release() "
"function, it is broken and must be fixed.\n",
dev_name(dev));
- kfree(p);
}
static struct kobj_type device_ktype = {
@@ -538,12 +536,6 @@ static void klist_children_put(struct klist_node *n)
*/
void device_initialize(struct device *dev)
{
- dev->p = kzalloc(sizeof(*dev->p), GFP_KERNEL);
- if (!dev->p) {
- WARN_ON(1);
- return;
- }
- dev->p->device = dev;
dev->kobj.kset = devices_kset;
kobject_init(&dev->kobj, &device_ktype);
klist_init(&dev->klist_children, klist_children_get,
diff --git a/include/linux/device.h b/include/linux/device.h
index 2975351..45e5b19 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -28,7 +28,6 @@
#define BUS_ID_SIZE 20
struct device;
-struct device_private;
struct device_driver;
struct driver_private;
struct class;
@@ -372,8 +371,6 @@ struct device {
struct klist_node knode_bus;
struct device *parent;
- struct device_private *p;
-
struct kobject kobj;
char bus_id[BUS_ID_SIZE]; /* position on parent bus */
unsigned uevent_suppress:1;
--
1.6.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [GIT PATCH] driver core fixes for your 2.6-git tree
@ 2009-01-21 5:18 Greg KH
0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2009-01-21 5:18 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel, Kay Sievers
Here are 5 bugfixes against your current kernel git tree.
They fix the following reported problems:
- klist blowing up on CRIS architecture
- some block device names showing up incorrectly due to
mishandled ! formatting
- sysfs binary file bugfix
- debugfs build breakage if it is disable and wimax is enabled.
- PNP modules not properly being autoloaded due to lowercase
issues in file2alias.c
All of these have been in the last -next release, with the majority of
them in the -next releases for the past week.
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/
The patches will be sent as a follow-on to this message to lkml for people
to see.
thanks,
greg k-h
------------
drivers/base/core.c | 6 ++++++
fs/sysfs/bin.c | 6 ++++++
include/linux/debugfs.h | 7 +++++++
include/linux/klist.h | 2 +-
scripts/mod/file2alias.c | 17 +++++++++++++++--
5 files changed, 35 insertions(+), 3 deletions(-)
---------------
Greg Kroah-Hartman (1):
sysfs: fix problems with binary files
Inaky Perez-Gonzalez (1):
debugfs: introduce stub for debugfs_create_size_t() when DEBUG_FS=n
Jesper Nilsson (1):
klist.c: bit 0 in pointer can't be used as flag
Kay Sievers (1):
PNP: fix broken pnp lowercasing for acpi module aliases
Roland Dreier (1):
driver core: Convert '/' to '!' in dev_set_name()
^ permalink raw reply [flat|nested] 9+ messages in thread
* [GIT PATCH] driver core fixes for your 2.6-git tree
@ 2009-01-28 23:25 Greg KH
0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2009-01-28 23:25 UTC (permalink / raw)
To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel
Here are 3 documentation bugfixes against your current kernel git tree.
All of these have been in the -next releases.
Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/
The patches will be sent as a follow-on to this message to lkml for people
to see.
thanks,
greg k-h
------------
Documentation/DocBook/uio-howto.tmpl | 88 +++++++++++++++++++++++++++
Documentation/ja_JP/stable_kernel_rules.txt | 15 +++--
drivers/base/core.c | 2 +-
3 files changed, 99 insertions(+), 6 deletions(-)
---------------
Hans J. Koch (1):
UIO: Add missing documentation of features added recently
Randy Dunlap (1):
driver-core: fix kernel-doc parameter name
Tsugikazu Shibata (1):
Sync patch for jp_JP/stable_kernel_rules.txt
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-01-28 23:27 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-09 23:20 [GIT PATCH] driver core fixes for your 2.6-git tree Greg KH
2009-01-09 23:20 ` [PATCH 1/4] Revert "driver core: move knode_bus into private structure" Greg Kroah-Hartman
2009-01-09 23:20 ` [PATCH 2/4] Revert "driver core: move knode_driver " Greg Kroah-Hartman
2009-01-09 23:20 ` [PATCH 3/4] Revert "driver core: move klist_children " Greg Kroah-Hartman
2009-01-09 23:20 ` [PATCH 4/4] Revert "driver core: create a private portion of struct device" Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2009-01-28 23:25 [GIT PATCH] driver core fixes for your 2.6-git tree Greg KH
2009-01-21 5:18 Greg KH
2008-12-17 19:27 Greg KH
2008-10-29 22:38 Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox