Re: [PATCH 05/16] TTY: add tty_port_tty_wakeup helper

2013-03-18 Thread Greg KH
On Fri, Mar 08, 2013 at 08:02:09PM +0100, Jiri Slaby wrote:
> On 03/08/2013 04:02 PM, Peter Hurley wrote:
> > On Thu, 2013-03-07 at 13:12 +0100, Jiri Slaby wrote:
> >> It allows for cleaning up on a considerable amount of places. They did
> >> port_get, wakeup, kref_put. Now the only thing needed is to call
> >> tty_port_tty_wakeup which does exactly that.
> >>
> >> One exception is ifx6x60 where tty_wakeup was open-coded. We now call
> >> tty_wakeup properly there.
> >>
> >> Signed-off-by: Jiri Slaby 
> >> ---
> >>  arch/um/drivers/line.c  |  8 +---
> > 
> > Cc: Jeff Dike 
> > Cc: Richard Weinberger 
> > 
> >>  drivers/isdn/capi/capi.c|  7 +--
> > 
> > Cc: Karsten Keil 
> > 
> >>  drivers/isdn/gigaset/interface.c|  6 +-
> > 
> > Cc: Hansjoerg Lipp 
> > Cc: Tilman Schmidt 
> > Cc: gigaset307x-com...@lists.sourceforge.net
> > Cc: net...@vger.kernel.org
> > 
> >>  drivers/net/usb/hso.c   | 13 ++---
> > 
> > Cc: Jan Dumon 
> > Cc: linux-...@vger.kernel.org
> > 
> >>  drivers/s390/char/sclp_tty.c|  9 ++---
> >>  drivers/s390/char/sclp_vt220.c  |  8 +---
> > 
> > Cc: Martin Schwidefsky 
> > Cc: Heiko Carstens 
> > Cc: linux...@de.ibm.com
> > Cc: linux-s...@vger.kernel.org
> > 
> >>  drivers/staging/fwserial/fwserial.c | 10 ++
> > 
> > Cc: Me :)
> > 
> >>  drivers/staging/serqt_usb2/serqt_usb2.c |  7 +--
> > 
> > Cc: YAMANE Toshiaki 
> > Cc: Devendra Naga 
> > 
> > and so on...
> > 
> > Same for the other mega-patches.
> 
> I'm not sure whether to CC all the people for such patches. I always
> tended not to and instead rely on people reading LKML :P.
> 
> If this is the preferred way, I of course can do it next time.

It's nice to at least cc: driver maintainers if you can, you can script
get_maintainers.pl to do this for you.  But don't worry about it this
time.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 05/16] TTY: add tty_port_tty_wakeup helper

2013-03-08 Thread Jiri Slaby
On 03/08/2013 04:02 PM, Peter Hurley wrote:
> On Thu, 2013-03-07 at 13:12 +0100, Jiri Slaby wrote:
>> It allows for cleaning up on a considerable amount of places. They did
>> port_get, wakeup, kref_put. Now the only thing needed is to call
>> tty_port_tty_wakeup which does exactly that.
>>
>> One exception is ifx6x60 where tty_wakeup was open-coded. We now call
>> tty_wakeup properly there.
>>
>> Signed-off-by: Jiri Slaby 
>> ---
>>  arch/um/drivers/line.c  |  8 +---
> 
>   Cc: Jeff Dike 
>   Cc: Richard Weinberger 
> 
>>  drivers/isdn/capi/capi.c|  7 +--
> 
>   Cc: Karsten Keil 
> 
>>  drivers/isdn/gigaset/interface.c|  6 +-
> 
>   Cc: Hansjoerg Lipp 
>   Cc: Tilman Schmidt 
>   Cc: gigaset307x-com...@lists.sourceforge.net
>   Cc: net...@vger.kernel.org
> 
>>  drivers/net/usb/hso.c   | 13 ++---
> 
>   Cc: Jan Dumon 
>   Cc: linux-...@vger.kernel.org
> 
>>  drivers/s390/char/sclp_tty.c|  9 ++---
>>  drivers/s390/char/sclp_vt220.c  |  8 +---
> 
>   Cc: Martin Schwidefsky 
>   Cc: Heiko Carstens 
>   Cc: linux...@de.ibm.com
>   Cc: linux-s...@vger.kernel.org
> 
>>  drivers/staging/fwserial/fwserial.c | 10 ++
> 
>   Cc: Me :)
> 
>>  drivers/staging/serqt_usb2/serqt_usb2.c |  7 +--
> 
>   Cc: YAMANE Toshiaki 
>   Cc: Devendra Naga 
> 
> and so on...
> 
> Same for the other mega-patches.

I'm not sure whether to CC all the people for such patches. I always
tended not to and instead rely on people reading LKML :P.

If this is the preferred way, I of course can do it next time.

-- 
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 05/16] TTY: add tty_port_tty_wakeup helper

2013-03-08 Thread Peter Hurley
On Thu, 2013-03-07 at 13:12 +0100, Jiri Slaby wrote:
> It allows for cleaning up on a considerable amount of places. They did
> port_get, wakeup, kref_put. Now the only thing needed is to call
> tty_port_tty_wakeup which does exactly that.
> 
> One exception is ifx6x60 where tty_wakeup was open-coded. We now call
> tty_wakeup properly there.
> 
> Signed-off-by: Jiri Slaby 
> ---
>  arch/um/drivers/line.c  |  8 +---

Cc: Jeff Dike 
Cc: Richard Weinberger 

>  drivers/isdn/capi/capi.c|  7 +--

Cc: Karsten Keil 

>  drivers/isdn/gigaset/interface.c|  6 +-

Cc: Hansjoerg Lipp 
Cc: Tilman Schmidt 
Cc: gigaset307x-com...@lists.sourceforge.net
Cc: net...@vger.kernel.org

>  drivers/net/usb/hso.c   | 13 ++---

Cc: Jan Dumon 
Cc: linux-...@vger.kernel.org

>  drivers/s390/char/sclp_tty.c|  9 ++---
>  drivers/s390/char/sclp_vt220.c  |  8 +---

Cc: Martin Schwidefsky 
Cc: Heiko Carstens 
Cc: linux...@de.ibm.com
Cc: linux-s...@vger.kernel.org

>  drivers/staging/fwserial/fwserial.c | 10 ++

Cc: Me :)

>  drivers/staging/serqt_usb2/serqt_usb2.c |  7 +--

Cc: YAMANE Toshiaki 
Cc: Devendra Naga 

and so on...

Same for the other mega-patches.

>  drivers/tty/ehv_bytechan.c  |  6 +-
>  drivers/tty/hvc/hvsi.c  |  7 +--
>  drivers/tty/nozomi.c|  6 +-
>  drivers/tty/serial/ifx6x60.c| 33 
> ++---
>  drivers/tty/tty_port.c  | 16 
>  drivers/usb/class/cdc-acm.c |  7 +--
>  drivers/usb/serial/digi_acceleport.c| 17 +++--
>  drivers/usb/serial/io_edgeport.c| 28 +---
>  drivers/usb/serial/keyspan_pda.c|  6 ++
>  drivers/usb/serial/mos7720.c|  8 ++--
>  drivers/usb/serial/mos7840.c|  7 ++-
>  drivers/usb/serial/ti_usb_3410_5052.c   |  7 ++-
>  drivers/usb/serial/usb-serial.c | 10 +-
>  include/linux/tty.h |  1 +
>  22 files changed, 51 insertions(+), 176 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 05/16] TTY: add tty_port_tty_wakeup helper

2013-03-07 Thread Jiri Slaby
It allows for cleaning up on a considerable amount of places. They did
port_get, wakeup, kref_put. Now the only thing needed is to call
tty_port_tty_wakeup which does exactly that.

One exception is ifx6x60 where tty_wakeup was open-coded. We now call
tty_wakeup properly there.

Signed-off-by: Jiri Slaby 
---
 arch/um/drivers/line.c  |  8 +---
 drivers/isdn/capi/capi.c|  7 +--
 drivers/isdn/gigaset/interface.c|  6 +-
 drivers/net/usb/hso.c   | 13 ++---
 drivers/s390/char/sclp_tty.c|  9 ++---
 drivers/s390/char/sclp_vt220.c  |  8 +---
 drivers/staging/fwserial/fwserial.c | 10 ++
 drivers/staging/serqt_usb2/serqt_usb2.c |  7 +--
 drivers/tty/ehv_bytechan.c  |  6 +-
 drivers/tty/hvc/hvsi.c  |  7 +--
 drivers/tty/nozomi.c|  6 +-
 drivers/tty/serial/ifx6x60.c| 33 ++---
 drivers/tty/tty_port.c  | 16 
 drivers/usb/class/cdc-acm.c |  7 +--
 drivers/usb/serial/digi_acceleport.c| 17 +++--
 drivers/usb/serial/io_edgeport.c| 28 +---
 drivers/usb/serial/keyspan_pda.c|  6 ++
 drivers/usb/serial/mos7720.c|  8 ++--
 drivers/usb/serial/mos7840.c|  7 ++-
 drivers/usb/serial/ti_usb_3410_5052.c   |  7 ++-
 drivers/usb/serial/usb-serial.c | 10 +-
 include/linux/tty.h |  1 +
 22 files changed, 51 insertions(+), 176 deletions(-)

diff --git a/arch/um/drivers/line.c b/arch/um/drivers/line.c
index f1b3857..cc206ed 100644
--- a/arch/um/drivers/line.c
+++ b/arch/um/drivers/line.c
@@ -248,7 +248,6 @@ static irqreturn_t line_write_interrupt(int irq, void *data)
 {
struct chan *chan = data;
struct line *line = chan->line;
-   struct tty_struct *tty;
int err;
 
/*
@@ -267,12 +266,7 @@ static irqreturn_t line_write_interrupt(int irq, void 
*data)
}
spin_unlock(&line->lock);
 
-   tty = tty_port_tty_get(&line->port);
-   if (tty == NULL)
-   return IRQ_NONE;
-
-   tty_wakeup(tty);
-   tty_kref_put(tty);
+   tty_port_tty_wakeup(&line->port);
 
return IRQ_HANDLED;
 }
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 89562a8..ac6f72b 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -569,7 +569,6 @@ static void capi_recv_message(struct capi20_appl *ap, 
struct sk_buff *skb)
 {
struct capidev *cdev = ap->private;
 #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
-   struct tty_struct *tty;
struct capiminor *mp;
u16 datahandle;
struct capincci *np;
@@ -627,11 +626,7 @@ static void capi_recv_message(struct capi20_appl *ap, 
struct sk_buff *skb)
 CAPIMSG_U16(skb->data, CAPIMSG_BASELEN + 4 + 2));
kfree_skb(skb);
capiminor_del_ack(mp, datahandle);
-   tty = tty_port_tty_get(&mp->port);
-   if (tty) {
-   tty_wakeup(tty);
-   tty_kref_put(tty);
-   }
+   tty_port_tty_wakeup(&mp->port);
handle_minor_send(mp);
 
} else {
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c
index e2b5396..600c79b 100644
--- a/drivers/isdn/gigaset/interface.c
+++ b/drivers/isdn/gigaset/interface.c
@@ -487,12 +487,8 @@ static const struct tty_operations if_ops = {
 static void if_wake(unsigned long data)
 {
struct cardstate *cs = (struct cardstate *)data;
-   struct tty_struct *tty = tty_port_tty_get(&cs->port);
 
-   if (tty) {
-   tty_wakeup(tty);
-   tty_kref_put(tty);
-   }
+   tty_port_tty_wakeup(&cs->port);
 }
 
 /*** interface to common ***/
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index e2dd324..a7714b4 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -1925,7 +1925,6 @@ static void hso_std_serial_write_bulk_callback(struct urb 
*urb)
 {
struct hso_serial *serial = urb->context;
int status = urb->status;
-   struct tty_struct *tty;
 
/* sanity check */
if (!serial) {
@@ -1941,11 +1940,7 @@ static void hso_std_serial_write_bulk_callback(struct 
urb *urb)
return;
}
hso_put_activity(serial->parent);
-   tty = tty_port_tty_get(&serial->port);
-   if (tty) {
-   tty_wakeup(tty);
-   tty_kref_put(tty);
-   }
+   tty_port_tty_wakeup(&serial->port);
hso_kick_transmit(serial);
 
D1(" ");
@@ -2008,12 +2003,8 @@ static void ctrl_callback(struct urb *urb)
put_rxbuf_data_and_resubmit_ctrl_urb(serial);
spin_unlock(&serial->serial_lock);
} else {
-   struct tty_struct *tty = tty_port_t