diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2012-01-06 12:26:41 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-07 08:53:35 -0500 |
commit | 6c59eefd58837cf674b18e8b8760d0d0870fa8d5 (patch) | |
tree | bd7655c02e0b845021cdf728f1f4c76f07569e96 /drivers | |
parent | 3796554671e6314e1ab368f5f09e302ba1bda538 (diff) |
[media] dvb-bt8xx: convert printks to pr_err()
This module does some printks with the loglevel missing.
pr_err() takes care of adding the KERN_ERR tag and the module name.
So we can simplify the code and add the missing printk loglevel by
using it.
Also add a #define pr_fmt() to make this work, and remove a few
unnecessary periods at the end of messages and bump the loglevel of
"Unknown bttv card type" from KERN_WARNING to KERN_ERR while at it.
Inspired-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/bt8xx/dvb-bt8xx.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index 6a6f7b95a0c0..81fab9adc1ca 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -19,6 +19,8 @@ | |||
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #define pr_fmt(fmt) "dvb_bt8xx: " fmt | ||
23 | |||
22 | #include <linux/bitops.h> | 24 | #include <linux/bitops.h> |
23 | #include <linux/module.h> | 25 | #include <linux/module.h> |
24 | #include <linux/init.h> | 26 | #include <linux/init.h> |
@@ -666,7 +668,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
666 | /* DST is not a frontend driver !!! */ | 668 | /* DST is not a frontend driver !!! */ |
667 | state = kmalloc(sizeof (struct dst_state), GFP_KERNEL); | 669 | state = kmalloc(sizeof (struct dst_state), GFP_KERNEL); |
668 | if (!state) { | 670 | if (!state) { |
669 | printk("dvb_bt8xx: No memory\n"); | 671 | pr_err("No memory\n"); |
670 | break; | 672 | break; |
671 | } | 673 | } |
672 | /* Setup the Card */ | 674 | /* Setup the Card */ |
@@ -676,7 +678,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
676 | state->dst_ca = NULL; | 678 | state->dst_ca = NULL; |
677 | /* DST is not a frontend, attaching the ASIC */ | 679 | /* DST is not a frontend, attaching the ASIC */ |
678 | if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) { | 680 | if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) { |
679 | printk("%s: Could not find a Twinhan DST.\n", __func__); | 681 | pr_err("%s: Could not find a Twinhan DST\n", __func__); |
680 | break; | 682 | break; |
681 | } | 683 | } |
682 | /* Attach other DST peripherals if any */ | 684 | /* Attach other DST peripherals if any */ |
@@ -705,14 +707,14 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
705 | } | 707 | } |
706 | 708 | ||
707 | if (card->fe == NULL) | 709 | if (card->fe == NULL) |
708 | printk("dvb-bt8xx: A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n", | 710 | pr_err("A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n", |
709 | card->bt->dev->vendor, | 711 | card->bt->dev->vendor, |
710 | card->bt->dev->device, | 712 | card->bt->dev->device, |
711 | card->bt->dev->subsystem_vendor, | 713 | card->bt->dev->subsystem_vendor, |
712 | card->bt->dev->subsystem_device); | 714 | card->bt->dev->subsystem_device); |
713 | else | 715 | else |
714 | if (dvb_register_frontend(&card->dvb_adapter, card->fe)) { | 716 | if (dvb_register_frontend(&card->dvb_adapter, card->fe)) { |
715 | printk("dvb-bt8xx: Frontend registration failed!\n"); | 717 | pr_err("Frontend registration failed!\n"); |
716 | dvb_frontend_detach(card->fe); | 718 | dvb_frontend_detach(card->fe); |
717 | card->fe = NULL; | 719 | card->fe = NULL; |
718 | } | 720 | } |
@@ -726,7 +728,7 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) | |||
726 | THIS_MODULE, &card->bt->dev->dev, | 728 | THIS_MODULE, &card->bt->dev->dev, |
727 | adapter_nr); | 729 | adapter_nr); |
728 | if (result < 0) { | 730 | if (result < 0) { |
729 | printk("dvb_bt8xx: dvb_register_adapter failed (errno = %d)\n", result); | 731 | pr_err("dvb_register_adapter failed (errno = %d)\n", result); |
730 | return result; | 732 | return result; |
731 | } | 733 | } |
732 | card->dvb_adapter.priv = card; | 734 | card->dvb_adapter.priv = card; |
@@ -746,7 +748,7 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) | |||
746 | 748 | ||
747 | result = dvb_dmx_init(&card->demux); | 749 | result = dvb_dmx_init(&card->demux); |
748 | if (result < 0) { | 750 | if (result < 0) { |
749 | printk("dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); | 751 | pr_err("dvb_dmx_init failed (errno = %d)\n", result); |
750 | goto err_unregister_adaptor; | 752 | goto err_unregister_adaptor; |
751 | } | 753 | } |
752 | 754 | ||
@@ -756,7 +758,7 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) | |||
756 | 758 | ||
757 | result = dvb_dmxdev_init(&card->dmxdev, &card->dvb_adapter); | 759 | result = dvb_dmxdev_init(&card->dmxdev, &card->dvb_adapter); |
758 | if (result < 0) { | 760 | if (result < 0) { |
759 | printk("dvb_bt8xx: dvb_dmxdev_init failed (errno = %d)\n", result); | 761 | pr_err("dvb_dmxdev_init failed (errno = %d)\n", result); |
760 | goto err_dmx_release; | 762 | goto err_dmx_release; |
761 | } | 763 | } |
762 | 764 | ||
@@ -764,7 +766,7 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) | |||
764 | 766 | ||
765 | result = card->demux.dmx.add_frontend(&card->demux.dmx, &card->fe_hw); | 767 | result = card->demux.dmx.add_frontend(&card->demux.dmx, &card->fe_hw); |
766 | if (result < 0) { | 768 | if (result < 0) { |
767 | printk("dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); | 769 | pr_err("dvb_dmx_init failed (errno = %d)\n", result); |
768 | goto err_dmxdev_release; | 770 | goto err_dmxdev_release; |
769 | } | 771 | } |
770 | 772 | ||
@@ -772,20 +774,19 @@ static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) | |||
772 | 774 | ||
773 | result = card->demux.dmx.add_frontend(&card->demux.dmx, &card->fe_mem); | 775 | result = card->demux.dmx.add_frontend(&card->demux.dmx, &card->fe_mem); |
774 | if (result < 0) { | 776 | if (result < 0) { |
775 | printk("dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); | 777 | pr_err("dvb_dmx_init failed (errno = %d)\n", result); |
776 | goto err_remove_hw_frontend; | 778 | goto err_remove_hw_frontend; |
777 | } | 779 | } |
778 | 780 | ||
779 | result = card->demux.dmx.connect_frontend(&card->demux.dmx, &card->fe_hw); | 781 | result = card->demux.dmx.connect_frontend(&card->demux.dmx, &card->fe_hw); |
780 | if (result < 0) { | 782 | if (result < 0) { |
781 | printk("dvb_bt8xx: dvb_dmx_init failed (errno = %d)\n", result); | 783 | pr_err("dvb_dmx_init failed (errno = %d)\n", result); |
782 | goto err_remove_mem_frontend; | 784 | goto err_remove_mem_frontend; |
783 | } | 785 | } |
784 | 786 | ||
785 | result = dvb_net_init(&card->dvb_adapter, &card->dvbnet, &card->demux.dmx); | 787 | result = dvb_net_init(&card->dvb_adapter, &card->dvbnet, &card->demux.dmx); |
786 | if (result < 0) { | 788 | if (result < 0) { |
787 | printk(KERN_ERR | 789 | pr_err("dvb_net_init failed (errno = %d)\n", result); |
788 | "dvb_bt8xx: dvb_net_init failed (errno = %d)\n", result); | ||
789 | goto err_disconnect_frontend; | 790 | goto err_disconnect_frontend; |
790 | } | 791 | } |
791 | 792 | ||
@@ -888,8 +889,7 @@ static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub) | |||
888 | break; | 889 | break; |
889 | 890 | ||
890 | default: | 891 | default: |
891 | printk(KERN_WARNING "dvb_bt8xx: Unknown bttv card type: %d.\n", | 892 | pr_err("Unknown bttv card type: %d\n", sub->core->type); |
892 | sub->core->type); | ||
893 | kfree(card); | 893 | kfree(card); |
894 | return -ENODEV; | 894 | return -ENODEV; |
895 | } | 895 | } |
@@ -897,16 +897,14 @@ static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub) | |||
897 | dprintk("dvb_bt8xx: identified card%d as %s\n", card->bttv_nr, card->card_name); | 897 | dprintk("dvb_bt8xx: identified card%d as %s\n", card->bttv_nr, card->card_name); |
898 | 898 | ||
899 | if (!(bttv_pci_dev = bttv_get_pcidev(card->bttv_nr))) { | 899 | if (!(bttv_pci_dev = bttv_get_pcidev(card->bttv_nr))) { |
900 | printk("dvb_bt8xx: no pci device for card %d\n", card->bttv_nr); | 900 | pr_err("no pci device for card %d\n", card->bttv_nr); |
901 | kfree(card); | 901 | kfree(card); |
902 | return -ENODEV; | 902 | return -ENODEV; |
903 | } | 903 | } |
904 | 904 | ||
905 | if (!(card->bt = dvb_bt8xx_878_match(card->bttv_nr, bttv_pci_dev))) { | 905 | if (!(card->bt = dvb_bt8xx_878_match(card->bttv_nr, bttv_pci_dev))) { |
906 | printk("dvb_bt8xx: unable to determine DMA core of card %d,\n", | 906 | pr_err("unable to determine DMA core of card %d,\n", card->bttv_nr); |
907 | card->bttv_nr); | 907 | pr_err("if you have the ALSA bt87x audio driver installed, try removing it.\n"); |
908 | printk("dvb_bt8xx: if you have the ALSA bt87x audio driver " | ||
909 | "installed, try removing it.\n"); | ||
910 | 908 | ||
911 | kfree(card); | 909 | kfree(card); |
912 | return -ENODEV; | 910 | return -ENODEV; |