mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] s390 (13/19): ctc driver.
@ 2003-09-25 17:21 Martin Schwidefsky
  0 siblings, 0 replies; only message in thread
From: Martin Schwidefsky @ 2003-09-25 17:21 UTC (permalink / raw)
  To: torvalds, linux-kernel

 - Add type attribute.
 - Remove initialization of device.name.
 - Remove unnecessary include.

diffstat:
 drivers/s390/net/ctcmain.c |   31 ++++++++++++++++++++++---------
 drivers/s390/net/ctctty.h  |    3 +--
 2 files changed, 23 insertions(+), 11 deletions(-)

diff -urN linux-2.6/drivers/s390/net/ctcmain.c linux-2.6-s390/drivers/s390/net/ctcmain.c
--- linux-2.6/drivers/s390/net/ctcmain.c	Thu Sep 25 18:33:27 2003
+++ linux-2.6-s390/drivers/s390/net/ctcmain.c	Thu Sep 25 18:33:31 2003
@@ -1,5 +1,5 @@
 /*
- * $Id: ctcmain.c,v 1.43 2003/05/27 11:34:23 mschwide Exp $
+ * $Id: ctcmain.c,v 1.47 2003/09/22 13:40:51 cohuck Exp $
  *
  * CTC / ESCON network driver
  *
@@ -36,7 +36,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.43 $
+ * RELEASE-TAG: CTC/ESCON network driver $Revision: 1.47 $
  *
  */
 \f
@@ -102,7 +102,7 @@
 #define READ			0
 #define WRITE			1
 
-#define CTC_ID_SIZE             DEVICE_ID_SIZE+3
+#define CTC_ID_SIZE             BUS_ID_SIZE+3
 \f
 
 struct ctc_profile {
@@ -272,7 +272,7 @@
 print_banner(void)
 {
 	static int printed = 0;
-	char vbuf[] = "$Revision: 1.43 $";
+	char vbuf[] = "$Revision: 1.47 $";
 	char *version = vbuf;
 
 	if (printed)
@@ -1791,7 +1791,7 @@
 	ch->ccw[7].cda = 0;
 
 	ch->cdev = cdev;
-	snprintf(ch->id, DEVICE_ID_SIZE, "ch-%s", cdev->dev.bus_id);
+	snprintf(ch->id, CTC_ID_SIZE, "ch-%s", cdev->dev.bus_id);
 	ch->type = type;
 	ch->fsm = init_fsm(ch->id, ch_state_names,
 			   ch_event_names, NR_CH_STATES, NR_CH_EVENTS,
@@ -2786,8 +2786,23 @@
 
 static DEVICE_ATTR(protocol, 0644, ctc_proto_show, ctc_proto_store);
 
+static ssize_t
+ctc_type_show(struct device *dev, char *buf)
+{
+	struct ccwgroup_device *cgdev;
+
+	cgdev = to_ccwgroupdev(dev);
+	if (!cgdev)
+		return -ENODEV;
+
+	return sprintf(buf, "%s\n", cu3088_type[cgdev->cdev[0]->id.driver_info]);
+}
+
+static DEVICE_ATTR(type, 0444, ctc_type_show, NULL);
+
 static struct attribute *ctc_attr[] = {
 	&dev_attr_protocol.attr,
+	&dev_attr_type.attr,
 	NULL,
 };
 
@@ -2845,8 +2860,6 @@
 	cgdev->dev.driver_data = priv;
 	cgdev->cdev[0]->dev.driver_data = priv;
 	cgdev->cdev[1]->dev.driver_data = priv;
-	snprintf(cgdev->dev.name, DEVICE_NAME_SIZE, "%s",
-		 cu3088_type[cgdev->cdev[0]->id.driver_info]);
 
 	return 0;
 }
@@ -2875,8 +2888,8 @@
 
 	type = get_channel_type(&cgdev->cdev[0]->id);
 	
-	snprintf(read_id, DEVICE_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id);
-	snprintf(write_id, DEVICE_ID_SIZE, "ch-%s", cgdev->cdev[1]->dev.bus_id);
+	snprintf(read_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[0]->dev.bus_id);
+	snprintf(write_id, CTC_ID_SIZE, "ch-%s", cgdev->cdev[1]->dev.bus_id);
 
 	if (add_channel(cgdev->cdev[0], type))
 		return -ENOMEM;
diff -urN linux-2.6/drivers/s390/net/ctctty.h linux-2.6-s390/drivers/s390/net/ctctty.h
--- linux-2.6/drivers/s390/net/ctctty.h	Mon Sep  8 21:49:51 2003
+++ linux-2.6-s390/drivers/s390/net/ctctty.h	Thu Sep 25 18:33:31 2003
@@ -1,5 +1,5 @@
 /*
- * $Id: ctctty.h,v 1.3 2002/10/24 16:42:55 cohuck Exp $
+ * $Id: ctctty.h,v 1.4 2003/09/18 08:01:10 mschwide Exp $
  *
  * CTC / ESCON network driver, tty interface.
  *
@@ -24,7 +24,6 @@
 #ifndef _CTCTTY_H_
 #define _CTCTTY_H_
 
-#include <linux/version.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-25 17:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-25 17:21 [PATCH] s390 (13/19): ctc driver Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®