diff options
author | Alexandre Bounine <alexandre.bounine@idt.com> | 2011-01-12 20:00:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 11:03:17 -0500 |
commit | ded05782719d0f7e79af98be7cf88c7e23a90435 (patch) | |
tree | 5f3fd7ed0d7f9903748b41edefcd3294de81bd5b /drivers/rapidio/rio-sysfs.c | |
parent | a93192a5d245a262dc52fa426de5b20467308a77 (diff) |
rapidio: integrate rio_switch into rio_dev
Convert RIO switches device structures (rio_dev + rio_switch) into a
single allocation unit.
This change is based on the fact that RIO switches are using common RIO
device objects anyway. Allocating RIO switch objects as RIO devices with
added space for switch information simplifies handling of RIO switch
devices.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Thomas Moll <thomas.moll@sysgo.com>
Cc: Micha Nelissen <micha@neli.hopto.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rapidio/rio-sysfs.c')
-rw-r--r-- | drivers/rapidio/rio-sysfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/rapidio/rio-sysfs.c b/drivers/rapidio/rio-sysfs.c index 137ed93ee33f..76b41853a877 100644 --- a/drivers/rapidio/rio-sysfs.c +++ b/drivers/rapidio/rio-sysfs.c | |||
@@ -217,7 +217,7 @@ int rio_create_sysfs_dev_files(struct rio_dev *rdev) | |||
217 | 217 | ||
218 | err = device_create_bin_file(&rdev->dev, &rio_config_attr); | 218 | err = device_create_bin_file(&rdev->dev, &rio_config_attr); |
219 | 219 | ||
220 | if (!err && rdev->rswitch) { | 220 | if (!err && (rdev->pef & RIO_PEF_SWITCH)) { |
221 | err = device_create_file(&rdev->dev, &dev_attr_routes); | 221 | err = device_create_file(&rdev->dev, &dev_attr_routes); |
222 | if (!err && rdev->rswitch->sw_sysfs) | 222 | if (!err && rdev->rswitch->sw_sysfs) |
223 | err = rdev->rswitch->sw_sysfs(rdev, RIO_SW_SYSFS_CREATE); | 223 | err = rdev->rswitch->sw_sysfs(rdev, RIO_SW_SYSFS_CREATE); |
@@ -239,7 +239,7 @@ int rio_create_sysfs_dev_files(struct rio_dev *rdev) | |||
239 | void rio_remove_sysfs_dev_files(struct rio_dev *rdev) | 239 | void rio_remove_sysfs_dev_files(struct rio_dev *rdev) |
240 | { | 240 | { |
241 | device_remove_bin_file(&rdev->dev, &rio_config_attr); | 241 | device_remove_bin_file(&rdev->dev, &rio_config_attr); |
242 | if (rdev->rswitch) { | 242 | if (rdev->pef & RIO_PEF_SWITCH) { |
243 | device_remove_file(&rdev->dev, &dev_attr_routes); | 243 | device_remove_file(&rdev->dev, &dev_attr_routes); |
244 | if (rdev->rswitch->sw_sysfs) | 244 | if (rdev->rswitch->sw_sysfs) |
245 | rdev->rswitch->sw_sysfs(rdev, RIO_SW_SYSFS_REMOVE); | 245 | rdev->rswitch->sw_sysfs(rdev, RIO_SW_SYSFS_REMOVE); |