From martyn.welch@gefanuc.com Fri Aug 7 17:07:35 2009 From: Martyn Welch Date: Thu, 06 Aug 2009 09:43:07 +0100 Subject: Staging: vme: Extend VME core probing for special matches To: greg@kroah.com Cc: devel@linuxdriverproject.org Message-ID: <20090806084307.31736.9463.stgit@ES-J7S4D2J.amer.consind.ge.com> Add the ability to define all slots and current slot in the VME buses bind table. Signed-off-by: Martyn Welch Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vme/vme.c | 14 +++++++++++--- drivers/staging/vme/vme.h | 3 +++ 2 files changed, 14 insertions(+), 3 deletions(-) --- a/drivers/staging/vme/vme.c +++ b/drivers/staging/vme/vme.c @@ -1302,9 +1302,17 @@ static int vme_bus_match(struct device * while((driver->bind_table[i].bus != 0) || (driver->bind_table[i].slot != 0)) { - if ((bridge->num == driver->bind_table[i].bus) && - (num == driver->bind_table[i].slot)) - return 1; + if (bridge->num == driver->bind_table[i].bus) { + if (num == driver->bind_table[i].slot) + return 1; + + if (driver->bind_table[i].slot == VME_SLOT_ALL) + return 1; + + if ((driver->bind_table[i].slot == VME_SLOT_CURRENT) && + (num == vme_slot_get(dev))) + return 1; + } i++; } --- a/drivers/staging/vme/vme.h +++ b/drivers/staging/vme/vme.h @@ -79,6 +79,9 @@ struct vme_resource { extern struct bus_type vme_bus_type; +#define VME_SLOT_CURRENT -1 +#define VME_SLOT_ALL -2 + struct vme_device_id { int bus; int slot;