chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4f8d44c
)
[PATCH] udev_rules.c: don't change sysfs_device while walking up the device chain
author
kay.sievers@vrfy.org
<kay.sievers@vrfy.org>
Mon, 28 Mar 2005 00:12:39 +0000
(
02:12
+0200)
committer
Greg KH
<gregkh@suse.de>
Wed, 27 Apr 2005 06:55:00 +0000
(23:55 -0700)
udev_rules.c
patch
|
blob
|
history
diff --git
a/udev_rules.c
b/udev_rules.c
index 2581dc2a78decf91901399653a29ea76d967aa5a..2fca33d06338f06afa4ba78e9f05be3628ebb26e 100644
(file)
--- a/
udev_rules.c
+++ b/
udev_rules.c
@@
-480,6
+480,8
@@
static int compare_sysfs_attribute(struct sysfs_class_device *class_dev, struct
static int match_rule(struct udevice *udev, struct udev_rule *rule,
struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device)
{
static int match_rule(struct udevice *udev, struct udev_rule *rule,
struct sysfs_class_device *class_dev, struct sysfs_device *sysfs_device)
{
+ struct sysfs_device *parent_device = sysfs_device;
+
if (rule->kernel[0] != '\0') {
dbg("check for " KEY_KERNEL " rule->kernel='%s' class_dev->name='%s'",
rule->kernel, class_dev->name);
if (rule->kernel[0] != '\0') {
dbg("check for " KEY_KERNEL " rule->kernel='%s' class_dev->name='%s'",
rule->kernel, class_dev->name);
@@
-541,13
+543,13
@@
static int match_rule(struct udevice *udev, struct udev_rule *rule,
while (1) {
/* check for matching driver */
if (rule->driver[0] != '\0') {
while (1) {
/* check for matching driver */
if (rule->driver[0] != '\0') {
- if (
sysfs
_device == NULL) {
+ if (
parent
_device == NULL) {
dbg("device has no sysfs_device");
goto exit;
}
dbg("check for " KEY_DRIVER " rule->driver='%s' sysfs_device->driver_name='%s'",
dbg("device has no sysfs_device");
goto exit;
}
dbg("check for " KEY_DRIVER " rule->driver='%s' sysfs_device->driver_name='%s'",
- rule->driver,
sysfs
_device->driver_name);
- if (strcmp_pattern(rule->driver,
sysfs
_device->driver_name) != 0) {
+ rule->driver,
parent
_device->driver_name);
+ if (strcmp_pattern(rule->driver,
parent
_device->driver_name) != 0) {
dbg(KEY_DRIVER " is not matching");
if (rule->driver_operation != KEY_OP_NOMATCH)
goto try_parent;
dbg(KEY_DRIVER " is not matching");
if (rule->driver_operation != KEY_OP_NOMATCH)
goto try_parent;
@@
-561,13
+563,13
@@
static int match_rule(struct udevice *udev, struct udev_rule *rule,
/* check for matching bus value */
if (rule->bus[0] != '\0') {
/* check for matching bus value */
if (rule->bus[0] != '\0') {
- if (
sysfs
_device == NULL) {
+ if (
parent
_device == NULL) {
dbg("device has no sysfs_device");
goto exit;
}
dbg("check for " KEY_BUS " rule->bus='%s' sysfs_device->bus='%s'",
dbg("device has no sysfs_device");
goto exit;
}
dbg("check for " KEY_BUS " rule->bus='%s' sysfs_device->bus='%s'",
- rule->bus,
sysfs
_device->bus);
- if (strcmp_pattern(rule->bus,
sysfs
_device->bus) != 0) {
+ rule->bus,
parent
_device->bus);
+ if (strcmp_pattern(rule->bus,
parent
_device->bus) != 0) {
dbg(KEY_BUS " is not matching");
if (rule->bus_operation != KEY_OP_NOMATCH)
goto try_parent;
dbg(KEY_BUS " is not matching");
if (rule->bus_operation != KEY_OP_NOMATCH)
goto try_parent;
@@
-581,12
+583,12
@@
static int match_rule(struct udevice *udev, struct udev_rule *rule,
/* check for matching bus id */
if (rule->id[0] != '\0') {
/* check for matching bus id */
if (rule->id[0] != '\0') {
- if (
sysfs
_device == NULL) {
+ if (
parent
_device == NULL) {
dbg("device has no sysfs_device");
goto exit;
}
dbg("check " KEY_ID);
dbg("device has no sysfs_device");
goto exit;
}
dbg("check " KEY_ID);
- if (strcmp_pattern(rule->id,
sysfs
_device->bus_id) != 0) {
+ if (strcmp_pattern(rule->id,
parent
_device->bus_id) != 0) {
dbg(KEY_ID " is not matching");
if (rule->id_operation != KEY_OP_NOMATCH)
goto try_parent;
dbg(KEY_ID " is not matching");
if (rule->id_operation != KEY_OP_NOMATCH)
goto try_parent;
@@
-607,7
+609,7
@@
static int match_rule(struct udevice *udev, struct udev_rule *rule,
struct key_pair *pair;
pair = &rule->sysfs_pair[i];
struct key_pair *pair;
pair = &rule->sysfs_pair[i];
- if (compare_sysfs_attribute(class_dev,
sysfs
_device, pair) != 0) {
+ if (compare_sysfs_attribute(class_dev,
parent
_device, pair) != 0) {
dbg(KEY_SYSFS "{'%s'} is not matching", pair->name);
if (pair->operation != KEY_OP_NOMATCH)
goto try_parent;
dbg(KEY_SYSFS "{'%s'} is not matching", pair->name);
if (pair->operation != KEY_OP_NOMATCH)
goto try_parent;
@@
-624,11
+626,11
@@
static int match_rule(struct udevice *udev, struct udev_rule *rule,
break;
try_parent:
dbg("try parent sysfs device");
break;
try_parent:
dbg("try parent sysfs device");
-
sysfs_device = sysfs_get_device_parent(sysfs
_device);
- if (
sysfs
_device == NULL)
+
parent_device = sysfs_get_device_parent(parent
_device);
+ if (
parent
_device == NULL)
goto exit;
goto exit;
- dbg("look at sysfs_device->path='%s'",
sysfs
_device->path);
- dbg("look at sysfs_device->bus_id='%s'",
sysfs
_device->bus_id);
+ dbg("look at sysfs_device->path='%s'",
parent
_device->path);
+ dbg("look at sysfs_device->bus_id='%s'",
parent
_device->bus_id);
}
/* execute external program */
}
/* execute external program */