[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091203122458.16bb57d2@lxorguk.ukuu.org.uk>
Date: Thu, 3 Dec 2009 12:24:58 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Rodolfo Giometti <giometti@...eenne.com>
Cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
David Woodhouse <dwmw2@...radead.org>,
Dave Jones <davej@...hat.com>, Sam Ravnborg <sam@...nborg.org>,
Greg KH <greg@...ah.com>,
Randy Dunlap <randy.dunlap@...cle.com>,
Kay Sievers <kay.sievers@...y.org>,
"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...e.hu>,
Michael Kerrisk <mtk.manpages@...il.com>,
Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH 06/11] pps: serial clients support.
> > void n_tty_init_ops(struct tty_ldisc_ops *ops)
> > {
> > *ops = tty_ldisc_N_TTY;
> > ops->owner = NULL:
> > ops->refcount = ops->flags = 0;
> > }
> > EXPORT_SYMBOL_GPL(n_tty_inherit_ops);
>
> The problem is that I have to do some operations into ldisc's open and
> close methods (see linux/drivers/pps/clients/pps-ldisc.c).
>
> By using your solution I inherit such methods but I cannot modify
> their behaviour in a manner suitable for register/deregister PPS
> support at runtime.
You can
n_tty_init_ops(&my_ops);
my_ops.num = whatever;
old_open = my_ops.open;
my_ops.open = pps_ntty_open;
etc
While not as pretty in C as C++ it works fine.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists