diff options
author | Manohar Vanga <manohar.vanga@cern.ch> | 2011-09-26 09:27:15 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-17 22:43:13 (GMT) |
commit | 8f966dc444b11adff6011a1d1fce424abdd876d8 (patch) | |
tree | 4ab26a8f584d360cac808dd8d0401e4377723aaa /drivers/staging/vme/devices/vme_user.c | |
parent | 9ad2e2e1d6506252f31a142a9b04121992af25e3 (diff) | |
download | linux-8f966dc444b11adff6011a1d1fce424abdd876d8.tar.xz |
staging: vme: add struct vme_dev for VME devices
Instead of using a vanilla 'struct device' for VME devices, add new
'struct vme_dev'. Modifications have been made to the VME framework
API as well as all in-tree VME drivers.
The new vme_dev structure has the following advantages from the
current model used by the driver:
* Driver functions (probe, remove) now receive a VME device
instead of a pointer to the bridge device (cleaner design)
* It's easier to differenciate API calls as bridge-based or
device-based (ie. cleaner interface).
Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Cc: Martyn Welch <martyn.welch@ge.com>
Reviewed-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/vme/devices/vme_user.c')
-rw-r--r-- | drivers/staging/vme/devices/vme_user.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 3cbeb2a..bb33dc2 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -116,7 +116,7 @@ static struct driver_stats statistics; static struct cdev *vme_user_cdev; /* Character device */ static struct class *vme_user_sysfs_class; /* Sysfs class */ -static struct device *vme_user_bridge; /* Pointer to bridge device */ +static struct vme_dev *vme_user_bridge; /* Pointer to user device */ static const int type[VME_DEVS] = { MASTER_MINOR, MASTER_MINOR, @@ -135,8 +135,8 @@ static ssize_t vme_user_write(struct file *, const char __user *, size_t, static loff_t vme_user_llseek(struct file *, loff_t, int); static long vme_user_unlocked_ioctl(struct file *, unsigned int, unsigned long); -static int __devinit vme_user_probe(struct device *, int, int); -static int __devexit vme_user_remove(struct device *, int, int); +static int __devinit vme_user_probe(struct vme_dev *); +static int __devexit vme_user_remove(struct vme_dev *); static const struct file_operations vme_user_fops = { .open = vme_user_open, @@ -689,8 +689,7 @@ err_nocard: * as practical. We will therefore reserve the buffers and request the images * here so that we don't have to do it later. */ -static int __devinit vme_user_probe(struct device *dev, int cur_bus, - int cur_slot) +static int __devinit vme_user_probe(struct vme_dev *vdev) { int i, err; char name[12]; @@ -702,7 +701,7 @@ static int __devinit vme_user_probe(struct device *dev, int cur_bus, err = -EINVAL; goto err_dev; } - vme_user_bridge = dev; + vme_user_bridge = vdev; /* Initialise descriptors */ for (i = 0; i < VME_DEVS; i++) { @@ -865,8 +864,7 @@ err_dev: return err; } -static int __devexit vme_user_remove(struct device *dev, int cur_bus, - int cur_slot) +static int __devexit vme_user_remove(struct vme_dev *dev) { int i; |