diff options
Diffstat (limited to 'drivers/message/i2o/device.c')
-rw-r--r-- | drivers/message/i2o/device.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c index eb907e87bc7b..280627ae6cf7 100644 --- a/drivers/message/i2o/device.c +++ b/drivers/message/i2o/device.c | |||
@@ -401,25 +401,27 @@ static int i2o_device_class_add(struct class_device *cd) | |||
401 | 401 | ||
402 | /* create user entries for this device */ | 402 | /* create user entries for this device */ |
403 | tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.user_tid); | 403 | tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.user_tid); |
404 | if (tmp) | 404 | if (tmp && (tmp != i2o_dev)) |
405 | sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj, | 405 | sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj, |
406 | "user"); | 406 | "user"); |
407 | 407 | ||
408 | /* create user entries refering to this device */ | 408 | /* create user entries refering to this device */ |
409 | list_for_each_entry(tmp, &c->devices, list) | 409 | list_for_each_entry(tmp, &c->devices, list) |
410 | if (tmp->lct_data.user_tid == i2o_dev->lct_data.tid) | 410 | if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid) |
411 | && (tmp != i2o_dev)) | ||
411 | sysfs_create_link(&tmp->device.kobj, | 412 | sysfs_create_link(&tmp->device.kobj, |
412 | &i2o_dev->device.kobj, "user"); | 413 | &i2o_dev->device.kobj, "user"); |
413 | 414 | ||
414 | /* create parent entries for this device */ | 415 | /* create parent entries for this device */ |
415 | tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.parent_tid); | 416 | tmp = i2o_iop_find_device(i2o_dev->iop, i2o_dev->lct_data.parent_tid); |
416 | if (tmp) | 417 | if (tmp && (tmp != i2o_dev)) |
417 | sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj, | 418 | sysfs_create_link(&i2o_dev->device.kobj, &tmp->device.kobj, |
418 | "parent"); | 419 | "parent"); |
419 | 420 | ||
420 | /* create parent entries refering to this device */ | 421 | /* create parent entries refering to this device */ |
421 | list_for_each_entry(tmp, &c->devices, list) | 422 | list_for_each_entry(tmp, &c->devices, list) |
422 | if (tmp->lct_data.parent_tid == i2o_dev->lct_data.tid) | 423 | if ((tmp->lct_data.parent_tid == i2o_dev->lct_data.tid) |
424 | && (tmp != i2o_dev)) | ||
423 | sysfs_create_link(&tmp->device.kobj, | 425 | sysfs_create_link(&tmp->device.kobj, |
424 | &i2o_dev->device.kobj, "parent"); | 426 | &i2o_dev->device.kobj, "parent"); |
425 | 427 | ||