[PATCH v4 07/16] staging: unisys: Do not use 0 as the default bus root device number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Don Zickus <dzickus@xxxxxxxxxx>

I used 0 as the device id for the bus root, neglecting the fact that
device 0 is a valid id in Unisys's configuration.  Modify this to
use UINT_MAX instead as a unique number.

As fallout from this change it was noticed the bus_no and dev_no was not
defined the same way consistently.  Fix visorbus.h to use u32 there.  Fix
the resulting printk warning too.

Signed-off-by: Don Zickus <dzickus@xxxxxxxxxx>
Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx>
---
 drivers/staging/unisys/include/visorbus.h       | 4 ++--
 drivers/staging/unisys/visorbus/visorbus_main.c | 2 +-
 drivers/staging/unisys/visorbus/visorchipset.c  | 6 ++++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/unisys/include/visorbus.h b/drivers/staging/unisys/include/visorbus.h
index 3152ba4..c60f7d4 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -150,8 +150,8 @@ struct visor_device {
 	struct semaphore visordriver_callback_lock;
 	bool pausing;
 	bool resuming;
-	unsigned long chipset_bus_no;
-	unsigned long chipset_dev_no;
+	u32 chipset_bus_no;
+	u32 chipset_dev_no;
 	struct visorchipset_state state;
 	uuid_le type;
 	uuid_le inst;
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index 7667b15..e5731b1 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -572,7 +572,7 @@ static ssize_t client_bus_info_show(struct device *dev,
 		if (vdev->name)
 			partition_name = vdev->name;
 		x = snprintf(p, remain,
-			     "Client device / client driver info for %s partition (vbus #%ld):\n",
+			     "Client device / client driver info for %s partition (vbus #%d):\n",
 			     partition_name, vdev->chipset_dev_no);
 		p += x;
 		remain -= x;
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 4dd0a07..618732b 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -56,6 +56,8 @@
 #define UNISYS_SPAR_ID_ECX 0x70537379
 #define UNISYS_SPAR_ID_EDX 0x34367261
 
+#define BUS_ROOT_DEVICE	UINT_MAX
+
 /*
  * Module parameters
  */
@@ -727,8 +729,8 @@ static int match_visorbus_dev_by_id(struct device *dev, void *data)
 	u32 bus_no = id->bus_no;
 	u32 dev_no = id->dev_no;
 
-	if (((bus_no == -1) || (vdev->chipset_bus_no == bus_no)) &&
-	    ((dev_no == -1) || (vdev->chipset_dev_no == dev_no)))
+	if ((vdev->chipset_bus_no == bus_no) &&
+	    (vdev->chipset_dev_no == dev_no))
 		return 1;
 
 	return 0;
-- 
2.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux