[DVB patch 34/48] saa7146: remove duplicate setgpio

Johannes Stezenbach
2005-03-22T02:09:08Z

[-- Attachment #1: dvb-saa7146-cleanup.patch --]
[-- Type: text/plain, Size: 1893 bytes --]

Remove duplicate setgpio (Kenneth Aafloy)

Signed-off-by: Johannes Stezenbach <js@linuxtv.org>

saa7146_core.c | 29 +++++------------------------
1 files changed, 5 insertions(+), 24 deletions(-)

Index: linux-2.6.12-rc1-mm1/drivers/media/common/saa7146_core.c
===================================================================
--- linux-2.6.12-rc1-mm1.orig/drivers/media/common/saa7146_core.c 2005-03-22 00:18:04.000000000 +0100
+++ linux-2.6.12-rc1-mm1/drivers/media/common/saa7146_core.c 2005-03-22 00:23:38.000000000 +0100
@@ -46,21 +46,15 @@ static void dump_registers(struct saa714
* gpio and debi helper functions
****************************************************************************/

-/* write "data" to the gpio-pin "pin" -- unused */
-void saa7146_set_gpio(struct saa7146_dev *dev, u8 pin, u8 data)
+void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data)
{
u32 value = 0;

- /* sanity check */
- if(pin > 3)
- return;
-
- /* read old register contents */
- value = saa7146_read(dev, GPIO_CTRL );
-
- value &= ~(0xff << (8*pin));
- value |= (data << (8*pin));
+ BUG_ON(port > 3);

+ value = saa7146_read(dev, GPIO_CTRL);
+ value &= ~(0xff << (8*port));
+ value |= (data << (8*port));
saa7146_write(dev, GPIO_CTRL, value);
}

@@ -236,19 +230,6 @@ int saa7146_pgtable_build_single(struct
}

/********************************************************************************/
-/* gpio functions */
-
-void saa7146_setgpio(struct saa7146_dev *dev, int port, u32 data)
-{
- u32 val = 0;
-
- val=saa7146_read(dev,GPIO_CTRL);
- val&=~(0xff << (8*(port)));
- val|=(data)<<(8*(port));
- saa7146_write(dev, GPIO_CTRL, val);
-}
-
-/********************************************************************************/
/* interrupt handler */
static irqreturn_t interrupt_hw(int irq, void *dev_id, struct pt_regs *regs)
{

--