diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2006-11-03 19:13:52 +0100 |
---|---|---|
committer | Oliver Endriss <o.endriss@gmx.de> | 2006-11-03 19:13:52 +0100 |
commit | 37331b41c67b0698f17c4534278cda7614ea0905 (patch) | |
tree | edfad7f7df4bd07ba69822a064ac00926f10971c | |
parent | 5052c5dbf9d724f1772eee1b0f2765f3d67c3318 (diff) | |
download | mediapointer-dvb-s2-37331b41c67b0698f17c4534278cda7614ea0905.tar.gz mediapointer-dvb-s2-37331b41c67b0698f17c4534278cda7614ea0905.tar.bz2 |
saa7146: Convert SAA7146_IER_{DIS,EN}ABLE macros to inline functions
From: Oliver Endriss <o.endriss@gmx.de>
Convert SAA7146_IER_{DIS,EN}ABLE macros to inline functions.
Fixes a problem with macro expansion (reported by C.Y.M).
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
-rw-r--r-- | linux/include/media/saa7146.h | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/linux/include/media/saa7146.h b/linux/include/media/saa7146.h index 6f3d14306..ab0a60b4d 100644 --- a/linux/include/media/saa7146.h +++ b/linux/include/media/saa7146.h @@ -54,20 +54,6 @@ extern unsigned int saa7146_debug; #define DEB_INT(x) if (0!=(DEBUG_VARIABLE&0x20)) { DEBUG_PROLOG; printk x; } /* interrupt debug messages */ #define DEB_CAP(x) if (0!=(DEBUG_VARIABLE&0x40)) { DEBUG_PROLOG; printk x; } /* capture debug messages */ -#define SAA7146_IER_DISABLE(x,y) \ - do { \ - unsigned int flags; \ - spin_lock_irqsave(&x->int_slock, flags); \ - saa7146_write(x, IER, saa7146_read(x, IER) & ~(y)); \ - spin_unlock_irqrestore(&x->int_slock, flags); \ - } while(0) -#define SAA7146_IER_ENABLE(x,y) \ - do { \ - unsigned int flags; \ - spin_lock_irqsave(&x->int_slock, flags); \ - saa7146_write(x, IER, saa7146_read(x, IER) | (y)); \ - spin_unlock_irqrestore(&x->int_slock, flags); \ - } while(0) #define SAA7146_ISR_CLEAR(x,y) \ saa7146_write(x, ISR, (y)); @@ -475,4 +461,20 @@ int saa7146_wait_for_debi_done(struct saa7146_dev *dev, int nobusyloop); #define SAA7146_I2C_BUS_BIT_RATE_80 (0x200) #define SAA7146_I2C_BUS_BIT_RATE_60 (0x300) +static inline void SAA7146_IER_DISABLE(struct saa7146_dev *x, unsigned y) +{ + unsigned long flags; + spin_lock_irqsave(&x->int_slock, flags); + saa7146_write(x, IER, saa7146_read(x, IER) & ~y); + spin_unlock_irqrestore(&x->int_slock, flags); +} + +static inline void SAA7146_IER_ENABLE(struct saa7146_dev *x, unsigned y) +{ + unsigned long flags; + spin_lock_irqsave(&x->int_slock, flags); + saa7146_write(x, IER, saa7146_read(x, IER) | y); + spin_unlock_irqrestore(&x->int_slock, flags); +} + #endif |