[PATCH 37/44] staging: unisys: Remove server flags

Benjamin Romer benjamin.romer at unisys.com
Wed May 13 17:22:31 UTC 2015


From: Don Zickus <dzickus at redhat.com>

The bus driver doesn't work in server mode, just remove the left over
pieces.

Signed-off-by: Don Zickus <dzickus at redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer at unisys.com>
---
 drivers/staging/unisys/visorbus/visorbus_main.c    | 66 +++-------------------
 drivers/staging/unisys/visorbus/visorbus_private.h |  5 --
 drivers/staging/unisys/visorbus/visorchipset.c     |  2 -
 3 files changed, 7 insertions(+), 66 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index ec20c46..7667b15 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -1074,54 +1074,6 @@ find_visor_device_by_channel(struct visorchannel *channel)
 }
 
 static int
-init_vbus_channel(struct visorchannel *chan)
-{
-	int rc = -1;
-	unsigned long allocated_bytes = visorchannel_get_nbytes(chan);
-	struct spar_vbus_channel_protocol *x =
-		kmalloc(sizeof(struct spar_vbus_channel_protocol),
-			GFP_KERNEL);
-
-	POSTCODE_LINUX_3(VBUS_CHANNEL_ENTRY_PC, rc, POSTCODE_SEVERITY_INFO);
-
-	if (x) {
-		POSTCODE_LINUX_2(MALLOC_FAILURE_PC, POSTCODE_SEVERITY_ERR);
-		goto away;
-	}
-	if (visorchannel_clear(chan, 0, 0, allocated_bytes) < 0) {
-		POSTCODE_LINUX_2(VBUS_CHANNEL_FAILURE_PC,
-				 POSTCODE_SEVERITY_ERR);
-		goto away;
-	}
-	if (visorchannel_read
-	    (chan, 0, x, sizeof(struct spar_vbus_channel_protocol)) < 0) {
-		POSTCODE_LINUX_2(VBUS_CHANNEL_FAILURE_PC,
-				 POSTCODE_SEVERITY_ERR);
-		goto away;
-	}
-	if (!SPAR_VBUS_CHANNEL_OK_SERVER(allocated_bytes)) {
-		POSTCODE_LINUX_2(VBUS_CHANNEL_FAILURE_PC,
-				 POSTCODE_SEVERITY_ERR);
-		goto away;
-	}
-
-	if (visorchannel_write
-	    (chan, 0, x, sizeof(struct spar_vbus_channel_protocol)) < 0) {
-		POSTCODE_LINUX_3(VBUS_CHANNEL_FAILURE_PC, chan,
-				 POSTCODE_SEVERITY_ERR);
-		goto away;
-	}
-
-	POSTCODE_LINUX_3(VBUS_CHANNEL_EXIT_PC, chan, POSTCODE_SEVERITY_INFO);
-	rc = 0;
-
-away:
-	kfree(x);
-	x = NULL;
-	return rc;
-}
-
-static int
 get_vbus_header_info(struct visorchannel *chan,
 		     struct spar_vbus_headerinfo *hdr_info)
 {
@@ -1296,18 +1248,14 @@ create_bus_instance(struct visorchipset_bus_info *bus_info)
 	}
 	dev->chipset_bus_no = id;
 	dev->visorchannel = bus_info->visorchannel;
-	if (bus_info->flags.server) {
-		init_vbus_channel(dev->visorchannel);
+	if (get_vbus_header_info(dev->visorchannel, hdr_info) >= 0) {
+		dev->vbus_hdr_info = (void *)hdr_info;
+		write_vbus_chp_info(dev->visorchannel, hdr_info,
+				    &chipset_driverinfo);
+		write_vbus_bus_info(dev->visorchannel, hdr_info,
+				    &clientbus_driverinfo);
 	} else {
-		if (get_vbus_header_info(dev->visorchannel, hdr_info) >= 0) {
-			dev->vbus_hdr_info = (void *)hdr_info;
-			write_vbus_chp_info(dev->visorchannel, hdr_info,
-					    &chipset_driverinfo);
-			write_vbus_bus_info(dev->visorchannel, hdr_info,
-					    &clientbus_driverinfo);
-		} else {
-			kfree(hdr_info);
-		}
+		kfree(hdr_info);
 	}
 	bus_count++;
 	list_add_tail(&dev->list_all, &list_all_bus_instances);
diff --git a/drivers/staging/unisys/visorbus/visorbus_private.h b/drivers/staging/unisys/visorbus/visorbus_private.h
index 57db062..af71809 100644
--- a/drivers/staging/unisys/visorbus/visorbus_private.h
+++ b/drivers/staging/unisys/visorbus/visorbus_private.h
@@ -66,11 +66,6 @@ struct visorchipset_bus_info {
 	u8 *description;	/* UTF8 */
 	u64 reserved1;
 	u32 reserved2;
-	struct {
-		u32 server:1;
-		/* Add new fields above. */
-		/* Remaining bits in this 32-bit word are unused. */
-	} flags;
 	struct controlvm_message_header *pending_msg_hdr;/* CONTROLVM MsgHdr */
 	/** For private use by the bus driver */
 	void *bus_driver_context;
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c b/drivers/staging/unisys/visorbus/visorchipset.c
index 417a4bf..e8a907f 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1228,8 +1228,6 @@ bus_create(struct controlvm_message *inmsg)
 
 	POSTCODE_LINUX_3(BUS_CREATE_ENTRY_PC, bus_no, POSTCODE_SEVERITY_INFO);
 
-	bus_info->flags.server = inmsg->hdr.flags.server;
-
 	visorchannel = visorchannel_create(cmd->create_bus.channel_addr,
 					   cmd->create_bus.channel_bytes,
 					   GFP_KERNEL,
-- 
2.1.4



More information about the devel mailing list