Hi,

The following diff removes useless double calls of ttyopen.  l_open is
a pointer to ttyopen().  All other serial drivers also just use l_open,
as it is the general API for this.

OK?

Bye,
Jan

Index: arch/luna88k/dev/siotty.c
===================================================================
RCS file: /cvs/src/sys/arch/luna88k/dev/siotty.c,v
retrieving revision 1.23
diff -u -p -r1.23 siotty.c
--- arch/luna88k/dev/siotty.c   25 Feb 2019 11:29:30 -0000      1.23
+++ arch/luna88k/dev/siotty.c   28 Dec 2020 14:40:29 -0000
@@ -503,9 +503,6 @@ sioopen(dev_t dev, int flag, int mode, s
                splx(s);
        }
 
-       error = ttyopen(dev, tp, p);
-       if (error > 0)
-               return error;
        return (*linesw[tp->t_line].l_open)(dev, tp, p);
 }
  
Index: arch/sh/dev/scif.c
===================================================================
RCS file: /cvs/src/sys/arch/sh/dev/scif.c,v
retrieving revision 1.19
diff -u -p -r1.19 scif.c
--- arch/sh/dev/scif.c  19 Feb 2018 08:59:52 -0000      1.19
+++ arch/sh/dev/scif.c  28 Dec 2020 14:41:05 -0000
@@ -756,10 +756,6 @@ scifopen(dev_t dev, int flag, int mode, 
 
        splx(s);
 
-       error = ttyopen(dev, tp, p);
-       if (error)
-               goto bad;
-
        error = (*linesw[tp->t_line].l_open)(dev, tp, p);
        if (error)
                goto bad;
Index: dev/pci/cz.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/cz.c,v
retrieving revision 1.24
diff -u -p -r1.24 cz.c
--- dev/pci/cz.c        21 May 2020 09:31:59 -0000      1.24
+++ dev/pci/cz.c        28 Dec 2020 14:41:30 -0000
@@ -1034,10 +1034,6 @@ czttyopen(dev_t dev, int flags, int mode
 
        splx(s);
 
-       error = ttyopen(CZTTY_DIALOUT(dev), tp, p);
-       if (error)
-               goto bad;
-
        error = (*linesw[tp->t_line].l_open)(dev, tp, p);
        if (error)
                goto bad;

Reply via email to