aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rapidio/rio-sysfs.c
diff options
context:
space:
mode:
authorAlexandre Bounine <alexandre.bounine@idt.com>2013-07-03 18:08:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:08:04 -0400
commit2ec3ba69faf301fb599e3651515e808e8efa533e (patch)
tree953f10726fd0cd61fec02082233c6097287d7257 /drivers/rapidio/rio-sysfs.c
parent36f0efbbe8e21c153dfc2f94c91f89ab06fd64c5 (diff)
rapidio: convert switch drivers to modules
Rework RapidIO switch drivers to add an option to build them as loadable kernel modules. This patch removes RapidIO-specific vmlinux section and converts switch drivers to be compatible with LDM driver registration method. To simplify registration of device-specific callback routines this patch introduces rio_switch_ops data structure. The sw_sysfs() callback is removed from the list of device-specific operations because under the new structure its functions can be handled by switch driver's probe() and remove() routines. If a specific switch device driver is not loaded the RapidIO subsystem core will use default standard-based operations to configure a switch. Because the current implementation of RapidIO enumeration/discovery method relies on availability of device-specific operations for error management, switch device drivers must be loaded before the RapidIO enumeration/discovery starts. This patch also moves several common routines from enumeration/discovery module into the RapidIO core code to make switch-specific operations accessible to all components of RapidIO subsystem. Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com> Cc: Matt Porter <mporter@kernel.crashing.org> Cc: Li Yang <leoli@freescale.com> Cc: Kumar Gala <galak@kernel.crashing.org> Cc: Andre van Herk <andre.van.herk@Prodrive.nl> Cc: Micha Nelissen <micha.nelissen@Prodrive.nl> Cc: Stef van Os <stef.van.os@Prodrive.nl> Cc: Jean Delvare <jdelvare@suse.de> 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.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/rapidio/rio-sysfs.c b/drivers/rapidio/rio-sysfs.c
index 66d4acd5e18f..864e52f193e1 100644
--- a/drivers/rapidio/rio-sysfs.c
+++ b/drivers/rapidio/rio-sysfs.c
@@ -257,8 +257,6 @@ int rio_create_sysfs_dev_files(struct rio_dev *rdev)
257 err |= device_create_file(&rdev->dev, &dev_attr_routes); 257 err |= device_create_file(&rdev->dev, &dev_attr_routes);
258 err |= device_create_file(&rdev->dev, &dev_attr_lnext); 258 err |= device_create_file(&rdev->dev, &dev_attr_lnext);
259 err |= device_create_file(&rdev->dev, &dev_attr_hopcount); 259 err |= device_create_file(&rdev->dev, &dev_attr_hopcount);
260 if (!err && rdev->rswitch->sw_sysfs)
261 err = rdev->rswitch->sw_sysfs(rdev, RIO_SW_SYSFS_CREATE);
262 } 260 }
263 261
264 if (err) 262 if (err)
@@ -281,8 +279,6 @@ void rio_remove_sysfs_dev_files(struct rio_dev *rdev)
281 device_remove_file(&rdev->dev, &dev_attr_routes); 279 device_remove_file(&rdev->dev, &dev_attr_routes);
282 device_remove_file(&rdev->dev, &dev_attr_lnext); 280 device_remove_file(&rdev->dev, &dev_attr_lnext);
283 device_remove_file(&rdev->dev, &dev_attr_hopcount); 281 device_remove_file(&rdev->dev, &dev_attr_hopcount);
284 if (rdev->rswitch->sw_sysfs)
285 rdev->rswitch->sw_sysfs(rdev, RIO_SW_SYSFS_REMOVE);
286 } 282 }
287} 283}
288 284