Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9577924b authored by Kees Cook's avatar Kees Cook Committed by Greg Kroah-Hartman
Browse files

char: pcmcia: Convert timers to use timer_setup()



In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Harald Welte <laforge@gnumonks.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jarod Wilson <jarod@redhat.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 24f0d316
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -659,9 +659,9 @@ static void terminate_monitor(struct cm4000_dev *dev)
 * is already doing that for you.
 * is already doing that for you.
 */
 */


static void monitor_card(unsigned long p)
static void monitor_card(struct timer_list *t)
{
{
	struct cm4000_dev *dev = (struct cm4000_dev *) p;
	struct cm4000_dev *dev = from_timer(dev, t, timer);
	unsigned int iobase = dev->p_dev->resource[0]->start;
	unsigned int iobase = dev->p_dev->resource[0]->start;
	unsigned short s;
	unsigned short s;
	struct ptsreq ptsreq;
	struct ptsreq ptsreq;
@@ -1374,7 +1374,7 @@ static void start_monitor(struct cm4000_dev *dev)
	DEBUGP(3, dev, "-> start_monitor\n");
	DEBUGP(3, dev, "-> start_monitor\n");
	if (!dev->monitor_running) {
	if (!dev->monitor_running) {
		DEBUGP(5, dev, "create, init and add timer\n");
		DEBUGP(5, dev, "create, init and add timer\n");
		setup_timer(&dev->timer, monitor_card, (unsigned long)dev);
		timer_setup(&dev->timer, monitor_card, 0);
		dev->monitor_running = 1;
		dev->monitor_running = 1;
		mod_timer(&dev->timer, jiffies);
		mod_timer(&dev->timer, jiffies);
	} else
	} else
+3 −4
Original line number Original line Diff line number Diff line
@@ -104,9 +104,9 @@ static inline unsigned char xinb(unsigned short port)


/* poll the device fifo status register.  not to be confused with
/* poll the device fifo status register.  not to be confused with
 * the poll syscall. */
 * the poll syscall. */
static void cm4040_do_poll(unsigned long dummy)
static void cm4040_do_poll(struct timer_list *t)
{
{
	struct reader_dev *dev = (struct reader_dev *) dummy;
	struct reader_dev *dev = from_timer(dev, t, poll_timer);
	unsigned int obs = xinb(dev->p_dev->resource[0]->start
	unsigned int obs = xinb(dev->p_dev->resource[0]->start
				+ REG_OFFSET_BUFFER_STATUS);
				+ REG_OFFSET_BUFFER_STATUS);


@@ -465,7 +465,6 @@ static int cm4040_open(struct inode *inode, struct file *filp)


	link->open = 1;
	link->open = 1;


	dev->poll_timer.data = (unsigned long) dev;
	mod_timer(&dev->poll_timer, jiffies + POLL_PERIOD);
	mod_timer(&dev->poll_timer, jiffies + POLL_PERIOD);


	DEBUGP(2, dev, "<- cm4040_open (successfully)\n");
	DEBUGP(2, dev, "<- cm4040_open (successfully)\n");
@@ -585,7 +584,7 @@ static int reader_probe(struct pcmcia_device *link)
	init_waitqueue_head(&dev->poll_wait);
	init_waitqueue_head(&dev->poll_wait);
	init_waitqueue_head(&dev->read_wait);
	init_waitqueue_head(&dev->read_wait);
	init_waitqueue_head(&dev->write_wait);
	init_waitqueue_head(&dev->write_wait);
	setup_timer(&dev->poll_timer, cm4040_do_poll, 0);
	timer_setup(&dev->poll_timer, cm4040_do_poll, 0);


	ret = reader_config(link, i);
	ret = reader_config(link, i);
	if (ret) {
	if (ret) {
+4 −4
Original line number Original line Diff line number Diff line
@@ -375,7 +375,7 @@ static void reset_device(MGSLPC_INFO *info);
static void hdlc_mode(MGSLPC_INFO *info);
static void hdlc_mode(MGSLPC_INFO *info);
static void async_mode(MGSLPC_INFO *info);
static void async_mode(MGSLPC_INFO *info);


static void tx_timeout(unsigned long context);
static void tx_timeout(struct timer_list *t);


static int carrier_raised(struct tty_port *port);
static int carrier_raised(struct tty_port *port);
static void dtr_rts(struct tty_port *port, int onoff);
static void dtr_rts(struct tty_port *port, int onoff);
@@ -1289,7 +1289,7 @@ static int startup(MGSLPC_INFO * info, struct tty_struct *tty)


	memset(&info->icount, 0, sizeof(info->icount));
	memset(&info->icount, 0, sizeof(info->icount));


	setup_timer(&info->tx_timer, tx_timeout, (unsigned long)info);
	timer_setup(&info->tx_timer, tx_timeout, 0);


	/* Allocate and claim adapter resources */
	/* Allocate and claim adapter resources */
	retval = claim_resources(info);
	retval = claim_resources(info);
@@ -3846,9 +3846,9 @@ static void trace_block(MGSLPC_INFO *info,const char* data, int count, int xmit)
/* HDLC frame time out
/* HDLC frame time out
 * update stats and do tx completion processing
 * update stats and do tx completion processing
 */
 */
static void tx_timeout(unsigned long context)
static void tx_timeout(struct timer_list *t)
{
{
	MGSLPC_INFO *info = (MGSLPC_INFO*)context;
	MGSLPC_INFO *info = from_timer(info, t, tx_timer);
	unsigned long flags;
	unsigned long flags;


	if (debug_level >= DEBUG_LEVEL_INFO)
	if (debug_level >= DEBUG_LEVEL_INFO)