]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/dvb/bt8xx/dst_ca.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6-omap-h63xx.git] / drivers / media / dvb / bt8xx / dst_ca.c
index fa923b9b346ea99440dceeac23e695c4c4b3a193..0258451423ad876b53e3e2a9b94044cf1b7025c9 100644 (file)
 #define dprintk(x, y, z, format, arg...) do {                                          \
        if (z) {                                                                        \
                if      ((x > DST_CA_ERROR) && (x > y))                                 \
-                       printk(KERN_ERR "%s: " format "\n", __FUNCTION__ , ##arg);      \
+                       printk(KERN_ERR "%s: " format "\n", __func__ , ##arg);  \
                else if ((x > DST_CA_NOTICE) && (x > y))                                \
-                       printk(KERN_NOTICE "%s: " format "\n", __FUNCTION__ , ##arg);   \
+                       printk(KERN_NOTICE "%s: " format "\n", __func__ , ##arg);       \
                else if ((x > DST_CA_INFO) && (x > y))                                  \
-                       printk(KERN_INFO "%s: " format "\n", __FUNCTION__ , ##arg);     \
+                       printk(KERN_INFO "%s: " format "\n", __func__ , ##arg); \
                else if ((x > DST_CA_DEBUG) && (x > y))                                 \
-                       printk(KERN_DEBUG "%s: " format "\n", __FUNCTION__ , ##arg);    \
+                       printk(KERN_DEBUG "%s: " format "\n", __func__ , ##arg);        \
        } else {                                                                        \
                if (x > y)                                                              \
                        printk(format, ## arg);                                         \
@@ -162,7 +162,7 @@ static int ca_get_app_info(struct dst_state *state)
        dprintk(verbose, DST_CA_INFO, 1, " ================================ CI Module Application Info ======================================");
        dprintk(verbose, DST_CA_INFO, 1, " Application Type=[%d], Application Vendor=[%d], Vendor Code=[%d]\n%s: Application info=[%s]",
                state->messages[7], (state->messages[8] << 8) | state->messages[9],
-               (state->messages[10] << 8) | state->messages[11], __FUNCTION__, (char *)(&state->messages[12]));
+               (state->messages[10] << 8) | state->messages[11], __func__, (char *)(&state->messages[12]));
        dprintk(verbose, DST_CA_INFO, 1, " ==================================================================================================");
 
        // Transform dst message to correct application_info message
@@ -480,7 +480,7 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message,
        struct ca_msg *hw_buffer;
        int result = 0;
 
-       if ((hw_buffer = (struct ca_msg *) kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) {
+       if ((hw_buffer = kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) {
                dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure");
                return -ENOMEM;
        }
@@ -699,12 +699,17 @@ static struct dvb_device dvbdev_ca = {
        .fops = &dst_ca_fops
 };
 
-int dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter)
+struct dvb_device *dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter)
 {
        struct dvb_device *dvbdev;
+
        dprintk(verbose, DST_CA_ERROR, 1, "registering DST-CA device");
-       dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst, DVB_DEVICE_CA);
-       return 0;
+       if (dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst, DVB_DEVICE_CA) == 0) {
+               dst->dst_ca = dvbdev;
+               return dst->dst_ca;
+       }
+
+       return NULL;
 }
 
 EXPORT_SYMBOL(dst_ca_attach);