Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47921
b: refs/heads/master
c: 40565f1
h: refs/heads/master
i:
  47919: a56bf4e
v: v3
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Feb 12, 2007
1 parent f6fd4d4 commit 82d8f74
Show file tree
Hide file tree
Showing 18 changed files with 76 additions and 124 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d096f3e9898d469493fc0afe88d7285c4bdc3ce2
refs/heads/master: 40565f1962c5be9b9e285e05af01ab7771534868
14 changes: 5 additions & 9 deletions trunk/drivers/char/drm/via_dmablit.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,8 @@ via_dmablit_handler(drm_device_t *dev, int engine, int from_irq)
blitq->cur = cur;
blitq->num_outstanding--;
blitq->end = jiffies + DRM_HZ;
if (!timer_pending(&blitq->poll_timer)) {
blitq->poll_timer.expires = jiffies+1;
add_timer(&blitq->poll_timer);
}
if (!timer_pending(&blitq->poll_timer))
mod_timer(&blitq->poll_timer, jiffies + 1);
} else {
if (timer_pending(&blitq->poll_timer)) {
del_timer(&blitq->poll_timer);
Expand Down Expand Up @@ -478,8 +476,7 @@ via_dmablit_timer(unsigned long data)
via_dmablit_handler(dev, engine, 0);

if (!timer_pending(&blitq->poll_timer)) {
blitq->poll_timer.expires = jiffies+1;
add_timer(&blitq->poll_timer);
mod_timer(&blitq->poll_timer, jiffies + 1);

/*
* Rerun handler to delete timer if engines are off, and
Expand Down Expand Up @@ -574,9 +571,8 @@ via_init_dmablit(drm_device_t *dev)
}
DRM_INIT_WAITQUEUE(&blitq->busy_queue);
INIT_WORK(&blitq->wq, via_dmablit_workqueue);
init_timer(&blitq->poll_timer);
blitq->poll_timer.function = &via_dmablit_timer;
blitq->poll_timer.data = (unsigned long) blitq;
setup_timer(&blitq->poll_timer, via_dmablit_timer,
(unsigned long)blitq);
}
}

Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/char/dtlk.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#define TRACE_RET ((void) 0)
#endif /* TRACING */

static void dtlk_timer_tick(unsigned long data);

static int dtlk_major;
static int dtlk_port_lpc;
Expand All @@ -81,7 +82,7 @@ static int dtlk_has_indexing;
static unsigned int dtlk_portlist[] =
{0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0};
static wait_queue_head_t dtlk_process_list;
static struct timer_list dtlk_timer;
static DEFINE_TIMER(dtlk_timer, dtlk_timer_tick, 0, 0);

/* prototypes for file_operations struct */
static ssize_t dtlk_read(struct file *, char __user *,
Expand Down Expand Up @@ -117,7 +118,6 @@ static char dtlk_write_tts(char);
/*
static void dtlk_handle_error(char, char, unsigned int);
*/
static void dtlk_timer_tick(unsigned long data);

static ssize_t dtlk_read(struct file *file, char __user *buf,
size_t count, loff_t * ppos)
Expand Down Expand Up @@ -318,7 +318,7 @@ static int dtlk_release(struct inode *inode, struct file *file)
}
TRACE_RET;

del_timer(&dtlk_timer);
del_timer_sync(&dtlk_timer);

return 0;
}
Expand All @@ -336,8 +336,6 @@ static int __init dtlk_init(void)
if (dtlk_dev_probe() == 0)
printk(", MAJOR %d\n", dtlk_major);

init_timer(&dtlk_timer);
dtlk_timer.function = dtlk_timer_tick;
init_waitqueue_head(&dtlk_process_list);

return 0;
Expand Down
30 changes: 17 additions & 13 deletions trunk/drivers/char/ip2/i2lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static int i2RetryFlushOutput(i2ChanStrPtr);
// Not a documented part of the library routines (careful...) but the Diagnostic
// i2diag.c finds them useful to help the throughput in certain limited
// single-threaded operations.
static void iiSendPendingMail(i2eBordStrPtr);
static inline void iiSendPendingMail(i2eBordStrPtr);
static void serviceOutgoingFifo(i2eBordStrPtr);

// Functions defined in ip2.c as part of interrupt handling
Expand Down Expand Up @@ -150,6 +150,13 @@ i2Validate ( i2ChanStrPtr pCh )
== (CHANNEL_MAGIC | CHANNEL_SUPPORT));
}

static void iiSendPendingMail_t(unsigned long data)
{
i2eBordStrPtr pB = (i2eBordStrPtr)data;

iiSendPendingMail(pB);
}

//******************************************************************************
// Function: iiSendPendingMail(pB)
// Parameters: Pointer to a board structure
Expand Down Expand Up @@ -184,12 +191,9 @@ iiSendPendingMail(i2eBordStrPtr pB)
/\/\|=mhw=|\/\/ */

if( ++pB->SendPendingRetry < 16 ) {

init_timer( &(pB->SendPendingTimer) );
pB->SendPendingTimer.expires = jiffies + 1;
pB->SendPendingTimer.function = (void*)(unsigned long)iiSendPendingMail;
pB->SendPendingTimer.data = (unsigned long)pB;
add_timer( &(pB->SendPendingTimer) );
setup_timer(&pB->SendPendingTimer,
iiSendPendingMail_t, (unsigned long)pB);
mod_timer(&pB->SendPendingTimer, jiffies + 1);
} else {
printk( KERN_ERR "IP2: iiSendPendingMail unable to queue outbound mail\n" );
}
Expand Down Expand Up @@ -1265,8 +1269,10 @@ i2RetryFlushOutput(i2ChanStrPtr pCh)
// soon as all the data is completely sent.
//******************************************************************************
static void
i2DrainWakeup(i2ChanStrPtr pCh)
i2DrainWakeup(unsigned long d)
{
i2ChanStrPtr pCh = (i2ChanStrPtr)d;

ip2trace (CHANN, ITRC_DRAIN, 10, 1, pCh->BookmarkTimer.expires );

pCh->BookmarkTimer.expires = 0;
Expand All @@ -1292,14 +1298,12 @@ i2DrainOutput(i2ChanStrPtr pCh, int timeout)
}
if ((timeout > 0) && (pCh->BookmarkTimer.expires == 0 )) {
// One per customer (channel)
init_timer( &(pCh->BookmarkTimer) );
pCh->BookmarkTimer.expires = jiffies + timeout;
pCh->BookmarkTimer.function = (void*)(unsigned long)i2DrainWakeup;
pCh->BookmarkTimer.data = (unsigned long)pCh;
setup_timer(&pCh->BookmarkTimer, i2DrainWakeup,
(unsigned long)pCh);

ip2trace (CHANN, ITRC_DRAIN, 1, 1, pCh->BookmarkTimer.expires );

add_timer( &(pCh->BookmarkTimer) );
mod_timer(&pCh->BookmarkTimer, jiffies + timeout);
}

i2QueueCommands( PTYPE_INLINE, pCh, -1, 1, CMD_BMARK_REQ );
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/char/n_r3964.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,7 @@ static int r3964_open(struct tty_struct *tty)
tty->disc_data = pInfo;
tty->receive_room = 65536;

init_timer(&pInfo->tmr);
pInfo->tmr.data = (unsigned long)pInfo;
pInfo->tmr.function = on_timeout;
setup_timer(&pInfo->tmr, on_timeout, (unsigned long)pInfo);

return 0;
}
Expand Down
13 changes: 5 additions & 8 deletions trunk/drivers/char/nwbutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
#define __NWBUTTON_C /* Tell the header file who we are */
#include "nwbutton.h"

static void button_sequence_finished (unsigned long parameters);

static int button_press_count; /* The count of button presses */
static struct timer_list button_timer; /* Times for the end of a sequence */
/* Times for the end of a sequence */
static DEFINE_TIMER(button_timer, button_sequence_finished, 0, 0);
static DECLARE_WAIT_QUEUE_HEAD(button_wait_queue); /* Used for blocking read */
static char button_output_buffer[32]; /* Stores data to write out of device */
static int bcount; /* The number of bytes in the buffer */
Expand Down Expand Up @@ -146,14 +149,8 @@ static void button_sequence_finished (unsigned long parameters)

static irqreturn_t button_handler (int irq, void *dev_id)
{
if (button_press_count) {
del_timer (&button_timer);
}
button_press_count++;
init_timer (&button_timer);
button_timer.function = button_sequence_finished;
button_timer.expires = (jiffies + bdelay);
add_timer (&button_timer);
mod_timer(&button_timer, jiffies + bdelay);

return IRQ_HANDLED;
}
Expand Down
10 changes: 3 additions & 7 deletions trunk/drivers/char/pcmcia/cm4000_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,8 +946,7 @@ static void monitor_card(unsigned long p)

return_with_timer:
DEBUGP(7, dev, "<- monitor_card (returns with timer)\n");
dev->timer.expires = jiffies + dev->mdelay;
add_timer(&dev->timer);
mod_timer(&dev->timer, jiffies + dev->mdelay);
clear_bit(LOCK_MONITOR, &dev->flags);
}

Expand Down Expand Up @@ -1406,12 +1405,9 @@ static void start_monitor(struct cm4000_dev *dev)
DEBUGP(3, dev, "-> start_monitor\n");
if (!dev->monitor_running) {
DEBUGP(5, dev, "create, init and add timer\n");
init_timer(&dev->timer);
setup_timer(&dev->timer, monitor_card, (unsigned long)dev);
dev->monitor_running = 1;
dev->timer.expires = jiffies;
dev->timer.data = (unsigned long) dev;
dev->timer.function = monitor_card;
add_timer(&dev->timer);
mod_timer(&dev->timer, jiffies);
} else
DEBUGP(5, dev, "monitor already running\n");
DEBUGP(3, dev, "<- start_monitor\n");
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/char/pcmcia/cm4040_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,7 @@ static int reader_probe(struct pcmcia_device *link)
init_waitqueue_head(&dev->poll_wait);
init_waitqueue_head(&dev->read_wait);
init_waitqueue_head(&dev->write_wait);
init_timer(&dev->poll_timer);
dev->poll_timer.function = &cm4040_do_poll;
setup_timer(&dev->poll_timer, cm4040_do_poll, 0);

ret = reader_config(link, i);
if (ret)
Expand Down
10 changes: 4 additions & 6 deletions trunk/drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1361,9 +1361,7 @@ static int startup(MGSLPC_INFO * info)

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

init_timer(&info->tx_timer);
info->tx_timer.data = (unsigned long)info;
info->tx_timer.function = tx_timeout;
setup_timer(&info->tx_timer, tx_timeout, (unsigned long)info);

/* Allocate and claim adapter resources */
retval = claim_resources(info);
Expand Down Expand Up @@ -1408,7 +1406,7 @@ static void shutdown(MGSLPC_INFO * info)
wake_up_interruptible(&info->status_event_wait_q);
wake_up_interruptible(&info->event_wait_q);

del_timer(&info->tx_timer);
del_timer_sync(&info->tx_timer);

if (info->tx_buf) {
free_page((unsigned long) info->tx_buf);
Expand Down Expand Up @@ -3549,8 +3547,8 @@ static void tx_start(MGSLPC_INFO *info)
} else {
info->tx_active = 1;
tx_ready(info);
info->tx_timer.expires = jiffies + msecs_to_jiffies(5000);
add_timer(&info->tx_timer);
mod_timer(&info->tx_timer, jiffies +
msecs_to_jiffies(5000));
}
}

Expand Down
12 changes: 4 additions & 8 deletions trunk/drivers/char/rio/rio_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,7 @@ static void rio_pollfunc(unsigned long data)
func_enter();

rio_interrupt(0, &p->RIOHosts[data]);
p->RIOHosts[data].timer.expires = jiffies + rio_poll;
add_timer(&p->RIOHosts[data].timer);
mod_timer(&p->RIOHosts[data].timer, jiffies + rio_poll);

func_exit();
}
Expand Down Expand Up @@ -1154,13 +1153,10 @@ static int __init rio_init(void)
/* Init the timer "always" to make sure that it can safely be
deleted when we unload... */

init_timer(&hp->timer);
setup_timer(&hp->timer, rio_pollfunc, i);
if (!hp->Ivec) {
rio_dprintk(RIO_DEBUG_INIT, "Starting polling at %dj intervals.\n", rio_poll);
hp->timer.data = i;
hp->timer.function = rio_pollfunc;
hp->timer.expires = jiffies + rio_poll;
add_timer(&hp->timer);
mod_timer(&hp->timer, jiffies + rio_poll);
}
}

Expand Down Expand Up @@ -1191,7 +1187,7 @@ static void __exit rio_exit(void)
rio_dprintk(RIO_DEBUG_INIT, "freed irq %d.\n", hp->Ivec);
}
/* It is safe/allowed to del_timer a non-active timer */
del_timer(&hp->timer);
del_timer_sync(&hp->timer);
if (hp->Caddr)
iounmap(hp->Caddr);
if (hp->Type == RIO_PCI)
Expand Down
10 changes: 3 additions & 7 deletions trunk/drivers/char/rocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@

/****** RocketPort Local Variables ******/

static void rp_do_poll(unsigned long dummy);

static struct tty_driver *rocket_driver;

static struct rocket_version driver_version = {
Expand All @@ -116,7 +118,7 @@ static struct r_port *rp_table[MAX_RP_PORTS]; /* The main repository of
static unsigned int xmit_flags[NUM_BOARDS]; /* Bit significant, indicates port had data to transmit. */
/* eg. Bit 0 indicates port 0 has xmit data, ... */
static atomic_t rp_num_ports_open; /* Number of serial ports open */
static struct timer_list rocket_timer;
static DEFINE_TIMER(rocket_timer, rp_do_poll, 0, 0);

static unsigned long board1; /* ISA addresses, retrieved from rocketport.conf */
static unsigned long board2;
Expand Down Expand Up @@ -2367,12 +2369,6 @@ static int __init rp_init(void)
if (!rocket_driver)
return -ENOMEM;

/*
* Set up the timer channel.
*/
init_timer(&rocket_timer);
rocket_timer.function = rp_do_poll;

/*
* Initialize the array of pointers to our own internal state
* structures.
Expand Down
12 changes: 5 additions & 7 deletions trunk/drivers/char/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ static struct fasync_struct *rtc_async_queue;
static DECLARE_WAIT_QUEUE_HEAD(rtc_wait);

#ifdef RTC_IRQ
static struct timer_list rtc_irq_timer;
static void rtc_dropped_irq(unsigned long data);

static DEFINE_TIMER(rtc_irq_timer, rtc_dropped_irq, 0, 0);
#endif

static ssize_t rtc_read(struct file *file, char __user *buf,
Expand All @@ -150,8 +152,6 @@ static unsigned int rtc_poll(struct file *file, poll_table *wait);

static void get_rtc_alm_time (struct rtc_time *alm_tm);
#ifdef RTC_IRQ
static void rtc_dropped_irq(unsigned long data);

static void set_rtc_irq_bit_locked(unsigned char bit);
static void mask_rtc_irq_bit_locked(unsigned char bit);

Expand Down Expand Up @@ -454,8 +454,8 @@ static int rtc_do_ioctl(unsigned int cmd, unsigned long arg, int kernel)

spin_lock_irqsave (&rtc_lock, flags);
if (!(rtc_status & RTC_TIMER_ON)) {
rtc_irq_timer.expires = jiffies + HZ/rtc_freq + 2*HZ/100;
add_timer(&rtc_irq_timer);
mod_timer(&rtc_irq_timer, jiffies + HZ/rtc_freq +
2*HZ/100);
rtc_status |= RTC_TIMER_ON;
}
set_rtc_irq_bit_locked(RTC_PIE);
Expand Down Expand Up @@ -1084,8 +1084,6 @@ static int __init rtc_init(void)
if (rtc_has_irq == 0)
goto no_irq2;

init_timer(&rtc_irq_timer);
rtc_irq_timer.function = rtc_dropped_irq;
spin_lock_irq(&rtc_lock);
rtc_freq = 1024;
if (!hpet_set_periodic_freq(rtc_freq)) {
Expand Down
12 changes: 4 additions & 8 deletions trunk/drivers/char/specialix.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,7 @@ void missed_irq (unsigned long data)
sx_interrupt (((struct specialix_board *)data)->irq,
(void*)data);
}
missed_irq_timer.expires = jiffies + sx_poll;
add_timer (&missed_irq_timer);
mod_timer(&missed_irq_timer, jiffies + sx_poll);
}
#endif

Expand Down Expand Up @@ -597,11 +596,8 @@ static int sx_probe(struct specialix_board *bp)
dprintk (SX_DEBUG_INIT, " GFCR = 0x%02x\n", sx_in_off(bp, CD186x_GFRCR) );

#ifdef SPECIALIX_TIMER
init_timer (&missed_irq_timer);
missed_irq_timer.function = missed_irq;
missed_irq_timer.data = (unsigned long) bp;
missed_irq_timer.expires = jiffies + sx_poll;
add_timer (&missed_irq_timer);
setup_timer(&missed_irq_timer, missed_irq, (unsigned long)bp);
mod_timer(&missed_irq_timer, jiffies + sx_poll);
#endif

printk(KERN_INFO"sx%d: specialix IO8+ board detected at 0x%03x, IRQ %d, CD%d Rev. %c.\n",
Expand Down Expand Up @@ -2559,7 +2555,7 @@ static void __exit specialix_exit_module(void)
if (sx_board[i].flags & SX_BOARD_PRESENT)
sx_release_io_range(&sx_board[i]);
#ifdef SPECIALIX_TIMER
del_timer (&missed_irq_timer);
del_timer_sync(&missed_irq_timer);
#endif

func_exit();
Expand Down
Loading

0 comments on commit 82d8f74

Please sign in to comment.