[PATCH] If a CALLOUT rule has a BUS id, then we must check to see if the device is on a bus.
Thanks to Martin Schlemmer <azarah@nosferatu.za.org> for pointing this out.
This commit is contained in:
parent
47b3f983da
commit
1d936fbca0
|
@ -399,7 +399,10 @@ static int do_callout(struct sysfs_class_device *class_dev, struct udevice *udev
|
||||||
if (dev->type != CALLOUT)
|
if (dev->type != CALLOUT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (sysfs_device) {
|
if (dev->bus[0] != '\0') {
|
||||||
|
/* as the user specified a bus, we must match it up */
|
||||||
|
if (!sysfs_device)
|
||||||
|
continue;
|
||||||
dbg("dev->bus='%s' sysfs_device->bus='%s'", dev->bus, sysfs_device->bus);
|
dbg("dev->bus='%s' sysfs_device->bus='%s'", dev->bus, sysfs_device->bus);
|
||||||
if (strcasecmp(dev->bus, sysfs_device->bus) != 0)
|
if (strcasecmp(dev->bus, sysfs_device->bus) != 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -215,13 +215,22 @@ CALLOUT, BUS="scsi", PROGRAM="/bin/echo -n node link1 link2", ID="node *", NAME=
|
||||||
EOF
|
EOF
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc => "callout for device with no bus",
|
desc => "invalid callout for device with no bus",
|
||||||
subsys => "tty",
|
subsys => "tty",
|
||||||
devpath => "class/tty/console",
|
devpath => "class/tty/console",
|
||||||
expected => "TTY" ,
|
expected => "TTY" ,
|
||||||
conf => <<EOF
|
conf => <<EOF
|
||||||
CALLOUT, BUS="scsi", PROGRAM="/bin/echo -n foo", ID="foo", NAME="foo"
|
CALLOUT, BUS="scsi", PROGRAM="/bin/echo -n foo", ID="foo", NAME="foo"
|
||||||
REPLACE, KERNEL="console", NAME="TTY"
|
REPLACE, KERNEL="console", NAME="TTY"
|
||||||
|
EOF
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc => "valid callout for device with no bus",
|
||||||
|
subsys => "tty",
|
||||||
|
devpath => "class/tty/console",
|
||||||
|
expected => "foo" ,
|
||||||
|
conf => <<EOF
|
||||||
|
CALLOUT, PROGRAM="/bin/echo -n foo", ID="foo", NAME="foo"
|
||||||
EOF
|
EOF
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue