]> err.no Git - linux-2.6/blobdiff - drivers/media/dvb/ttpci/av7110.c
Merge branch 'linus' into x86/cleanups
[linux-2.6] / drivers / media / dvb / ttpci / av7110.c
index 0e5701bdff19472bd08ec89a6b3219f9f634310e..f05d43d8b5cf25cfef2bdc0e866c97080ffca257 100644 (file)
@@ -51,6 +51,7 @@
 #include <linux/crc32.h>
 #include <linux/i2c.h>
 #include <linux/kthread.h>
+#include <asm/unaligned.h>
 
 #include <asm/system.h>
 
@@ -112,6 +113,8 @@ MODULE_PARM_DESC(wss_cfg_16_9, "WSS 16:9 - default 0x0007 - bit 15: disable, 14:
 module_param(tv_standard, int, 0444);
 MODULE_PARM_DESC(tv_standard, "TV standard: 0 PAL (default), 1 NTSC");
 
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
+
 static void restart_feeds(struct av7110 *av7110);
 
 static int av7110_num;
@@ -359,7 +362,7 @@ static inline void start_debi_dma(struct av7110 *av7110, int dir,
 {
        dprintk(8, "%c %08lx %u\n", dir == DEBI_READ ? 'R' : 'W', addr, len);
        if (saa7146_wait_for_debi_done(av7110->dev, 0)) {
-               printk(KERN_ERR "%s: saa7146_wait_for_debi_done timed out\n", __FUNCTION__);
+               printk(KERN_ERR "%s: saa7146_wait_for_debi_done timed out\n", __func__);
                return;
        }
 
@@ -497,7 +500,7 @@ static void gpioirq(unsigned long data)
                       saa7146_read(av7110->dev, SSR));
 
        if (saa7146_wait_for_debi_done(av7110->dev, 0)) {
-               printk(KERN_ERR "%s: saa7146_wait_for_debi_done timed out\n", __FUNCTION__);
+               printk(KERN_ERR "%s: saa7146_wait_for_debi_done timed out\n", __func__);
                BUG(); /* maybe we should try resetting the debi? */
        }
 
@@ -827,7 +830,7 @@ static int StartHWFilter(struct dvb_demux_filter *dvbdmxfilter)
        if (ret != 0 || handle >= 32) {
                printk("dvb-ttpci: %s error  buf %04x %04x %04x %04x  "
                                "ret %d  handle %04x\n",
-                               __FUNCTION__, buf[0], buf[1], buf[2], buf[3],
+                               __func__, buf[0], buf[1], buf[2], buf[3],
                                ret, handle);
                dvbdmxfilter->hw_handle = 0xffff;
                if (!ret)
@@ -854,7 +857,7 @@ static int StopHWFilter(struct dvb_demux_filter *dvbdmxfilter)
        handle = dvbdmxfilter->hw_handle;
        if (handle >= 32) {
                printk("%s tried to stop invalid filter %04x, filter type = %x\n",
-                               __FUNCTION__, handle, dvbdmxfilter->type);
+                               __func__, handle, dvbdmxfilter->type);
                return -EINVAL;
        }
 
@@ -867,7 +870,7 @@ static int StopHWFilter(struct dvb_demux_filter *dvbdmxfilter)
        if (ret != 0 || answ[1] != handle) {
                printk("dvb-ttpci: %s error  cmd %04x %04x %04x  ret %x  "
                                "resp %04x %04x  pid %d\n",
-                               __FUNCTION__, buf[0], buf[1], buf[2], ret,
+                               __func__, buf[0], buf[1], buf[2], ret,
                                answ[0], answ[1], dvbdmxfilter->feed->pid);
                if (!ret)
                        ret = -1;
@@ -1122,7 +1125,7 @@ static int dvb_get_stc(struct dmx_demux *demux, unsigned int num,
 
        ret = av7110_fw_request(av7110, &tag, 0, fwstc, 4);
        if (ret) {
-               printk(KERN_ERR "%s: av7110_fw_request error\n", __FUNCTION__);
+               printk(KERN_ERR "%s: av7110_fw_request error\n", __func__);
                return ret;
        }
        dprintk(2, "fwstc = %04hx %04hx %04hx %04hx\n",
@@ -1459,9 +1462,9 @@ static int check_firmware(struct av7110* av7110)
        ptr += 4;
 
        /* check dpram file */
-       crc = ntohl(*(u32*) ptr);
+       crc = get_unaligned_be32(ptr);
        ptr += 4;
-       len = ntohl(*(u32*) ptr);
+       len = get_unaligned_be32(ptr);
        ptr += 4;
        if (len >= 512) {
                printk("dvb-ttpci: dpram file is way too big.\n");
@@ -1476,9 +1479,9 @@ static int check_firmware(struct av7110* av7110)
        ptr += len;
 
        /* check root file */
-       crc = ntohl(*(u32*) ptr);
+       crc = get_unaligned_be32(ptr);
        ptr += 4;
-       len = ntohl(*(u32*) ptr);
+       len = get_unaligned_be32(ptr);
        ptr += 4;
 
        if (len <= 200000 || len >= 300000 ||
@@ -2461,7 +2464,7 @@ static int __devinit av7110_attach(struct saa7146_dev* dev,
                goto err_kfree_0;
 
        ret = dvb_register_adapter(&av7110->dvb_adapter, av7110->card_name,
-                                  THIS_MODULE, &dev->pci->dev);
+                                  THIS_MODULE, &dev->pci->dev, adapter_nr);
        if (ret < 0)
                goto err_put_firmware_1;