Commit 941830c9278a72e31389eb04cdfc397f66866de0
1 parent
8edeb6eb1a
Exists in
master
and in
4 other branches
[media] xc4000: make checkpatch.pl happy
Solve the ./scripts/checkpatch.pl compliants for the patches that added xc4000 support, including a few changes at dib0700. While here, remove a few printk noise by converting some msgs into debug ones. Cc: Istvan Varga <istvan_v@mailbox.hu> Cc: Patrick Boettcher <pboettcher@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Showing 3 changed files with 71 additions and 73 deletions Side-by-side Diff
drivers/media/common/tuners/xc4000.c
... | ... | @@ -244,8 +244,8 @@ |
244 | 244 | {"DTV8", 0x00C0, 0x800B, 0}, |
245 | 245 | {"DTV7/8", 0x00C0, 0x801B, 0}, |
246 | 246 | {"DTV7", 0x00C0, 0x8007, 0}, |
247 | - {"FM Radio-INPUT2", 0x0008, 0x9800,10700}, | |
248 | - {"FM Radio-INPUT1", 0x0008, 0x9000,10700} | |
247 | + {"FM Radio-INPUT2", 0x0008, 0x9800, 10700}, | |
248 | + {"FM Radio-INPUT1", 0x0008, 0x9000, 10700} | |
249 | 249 | }; |
250 | 250 | |
251 | 251 | static int xc4000_readreg(struct xc4000_priv *priv, u16 reg, u16 *val); |
... | ... | @@ -261,7 +261,7 @@ |
261 | 261 | printk(KERN_ERR "xc4000: I2C write failed (len=%i)\n", |
262 | 262 | len); |
263 | 263 | if (len == 4) { |
264 | - printk("bytes %02x %02x %02x %02x\n", buf[0], | |
264 | + printk(KERN_ERR "bytes %02x %02x %02x %02x\n", buf[0], | |
265 | 265 | buf[1], buf[2], buf[3]); |
266 | 266 | } |
267 | 267 | return -EREMOTEIO; |
... | ... | @@ -546,7 +546,7 @@ |
546 | 546 | }; |
547 | 547 | |
548 | 548 | if (i2c_transfer(priv->i2c_props.adap, msg, 2) != 2) { |
549 | - printk(KERN_WARNING "xc4000: I2C read failed\n"); | |
549 | + printk(KERN_ERR "xc4000: I2C read failed\n"); | |
550 | 550 | return -EREMOTEIO; |
551 | 551 | } |
552 | 552 | |
553 | 553 | |
554 | 554 | |
555 | 555 | |
556 | 556 | |
557 | 557 | |
558 | 558 | |
559 | 559 | |
560 | 560 | |
561 | 561 | |
562 | 562 | |
563 | 563 | |
564 | 564 | |
565 | 565 | |
566 | 566 | |
567 | 567 | |
568 | 568 | |
569 | 569 | |
570 | 570 | |
571 | 571 | |
572 | 572 | |
573 | 573 | |
574 | 574 | |
575 | 575 | |
576 | 576 | |
577 | 577 | |
578 | 578 | |
579 | 579 | |
580 | 580 | |
581 | 581 | |
582 | 582 | |
... | ... | @@ -558,67 +558,67 @@ |
558 | 558 | static void dump_firm_type_and_int_freq(unsigned int type, u16 int_freq) |
559 | 559 | { |
560 | 560 | if (type & BASE) |
561 | - printk("BASE "); | |
561 | + printk(KERN_CONT "BASE "); | |
562 | 562 | if (type & INIT1) |
563 | - printk("INIT1 "); | |
563 | + printk(KERN_CONT "INIT1 "); | |
564 | 564 | if (type & F8MHZ) |
565 | - printk("F8MHZ "); | |
565 | + printk(KERN_CONT "F8MHZ "); | |
566 | 566 | if (type & MTS) |
567 | - printk("MTS "); | |
567 | + printk(KERN_CONT "MTS "); | |
568 | 568 | if (type & D2620) |
569 | - printk("D2620 "); | |
569 | + printk(KERN_CONT "D2620 "); | |
570 | 570 | if (type & D2633) |
571 | - printk("D2633 "); | |
571 | + printk(KERN_CONT "D2633 "); | |
572 | 572 | if (type & DTV6) |
573 | - printk("DTV6 "); | |
573 | + printk(KERN_CONT "DTV6 "); | |
574 | 574 | if (type & QAM) |
575 | - printk("QAM "); | |
575 | + printk(KERN_CONT "QAM "); | |
576 | 576 | if (type & DTV7) |
577 | - printk("DTV7 "); | |
577 | + printk(KERN_CONT "DTV7 "); | |
578 | 578 | if (type & DTV78) |
579 | - printk("DTV78 "); | |
579 | + printk(KERN_CONT "DTV78 "); | |
580 | 580 | if (type & DTV8) |
581 | - printk("DTV8 "); | |
581 | + printk(KERN_CONT "DTV8 "); | |
582 | 582 | if (type & FM) |
583 | - printk("FM "); | |
583 | + printk(KERN_CONT "FM "); | |
584 | 584 | if (type & INPUT1) |
585 | - printk("INPUT1 "); | |
585 | + printk(KERN_CONT "INPUT1 "); | |
586 | 586 | if (type & LCD) |
587 | - printk("LCD "); | |
587 | + printk(KERN_CONT "LCD "); | |
588 | 588 | if (type & NOGD) |
589 | - printk("NOGD "); | |
589 | + printk(KERN_CONT "NOGD "); | |
590 | 590 | if (type & MONO) |
591 | - printk("MONO "); | |
591 | + printk(KERN_CONT "MONO "); | |
592 | 592 | if (type & ATSC) |
593 | - printk("ATSC "); | |
593 | + printk(KERN_CONT "ATSC "); | |
594 | 594 | if (type & IF) |
595 | - printk("IF "); | |
595 | + printk(KERN_CONT "IF "); | |
596 | 596 | if (type & LG60) |
597 | - printk("LG60 "); | |
597 | + printk(KERN_CONT "LG60 "); | |
598 | 598 | if (type & ATI638) |
599 | - printk("ATI638 "); | |
599 | + printk(KERN_CONT "ATI638 "); | |
600 | 600 | if (type & OREN538) |
601 | - printk("OREN538 "); | |
601 | + printk(KERN_CONT "OREN538 "); | |
602 | 602 | if (type & OREN36) |
603 | - printk("OREN36 "); | |
603 | + printk(KERN_CONT "OREN36 "); | |
604 | 604 | if (type & TOYOTA388) |
605 | - printk("TOYOTA388 "); | |
605 | + printk(KERN_CONT "TOYOTA388 "); | |
606 | 606 | if (type & TOYOTA794) |
607 | - printk("TOYOTA794 "); | |
607 | + printk(KERN_CONT "TOYOTA794 "); | |
608 | 608 | if (type & DIBCOM52) |
609 | - printk("DIBCOM52 "); | |
609 | + printk(KERN_CONT "DIBCOM52 "); | |
610 | 610 | if (type & ZARLINK456) |
611 | - printk("ZARLINK456 "); | |
611 | + printk(KERN_CONT "ZARLINK456 "); | |
612 | 612 | if (type & CHINA) |
613 | - printk("CHINA "); | |
613 | + printk(KERN_CONT "CHINA "); | |
614 | 614 | if (type & F6MHZ) |
615 | - printk("F6MHZ "); | |
615 | + printk(KERN_CONT "F6MHZ "); | |
616 | 616 | if (type & INPUT2) |
617 | - printk("INPUT2 "); | |
617 | + printk(KERN_CONT "INPUT2 "); | |
618 | 618 | if (type & SCODE) |
619 | - printk("SCODE "); | |
619 | + printk(KERN_CONT "SCODE "); | |
620 | 620 | if (type & HAS_IF) |
621 | - printk("HAS_IF_%d ", int_freq); | |
621 | + printk(KERN_CONT "HAS_IF_%d ", int_freq); | |
622 | 622 | } |
623 | 623 | |
624 | 624 | static int seek_firmware(struct dvb_frontend *fe, unsigned int type, |
... | ... | @@ -666,7 +666,8 @@ |
666 | 666 | } |
667 | 667 | |
668 | 668 | if (best_nr_diffs > 0U) { |
669 | - printk("Selecting best matching firmware (%u bits differ) for " | |
669 | + printk(KERN_WARNING | |
670 | + "Selecting best matching firmware (%u bits differ) for " | |
670 | 671 | "type=(%x), id %016llx:\n", |
671 | 672 | best_nr_diffs, type, (unsigned long long)*id); |
672 | 673 | i = best_i; |
673 | 674 | |
... | ... | @@ -677,10 +678,10 @@ |
677 | 678 | |
678 | 679 | ret: |
679 | 680 | if (debug) { |
680 | - printk("%s firmware for type=", | |
681 | + printk(KERN_DEBUG "%s firmware for type=", | |
681 | 682 | (i < 0) ? "Can't find" : "Found"); |
682 | 683 | dump_firm_type(type); |
683 | - printk("(%x), id %016llx.\n", type, (unsigned long long)*id); | |
684 | + printk(KERN_DEBUG "(%x), id %016llx.\n", type, (unsigned long long)*id); | |
684 | 685 | } |
685 | 686 | return i; |
686 | 687 | } |
687 | 688 | |
688 | 689 | |
... | ... | @@ -723,13 +724,13 @@ |
723 | 724 | else |
724 | 725 | fname = XC4000_DEFAULT_FIRMWARE; |
725 | 726 | |
726 | - printk("Reading firmware %s\n", fname); | |
727 | + dprintk(1, "Reading firmware %s\n", fname); | |
727 | 728 | rc = request_firmware(&fw, fname, priv->i2c_props.adap->dev.parent); |
728 | 729 | if (rc < 0) { |
729 | 730 | if (rc == -ENOENT) |
730 | - printk("Error: firmware %s not found.\n", fname); | |
731 | + printk(KERN_ERR "Error: firmware %s not found.\n", fname); | |
731 | 732 | else |
732 | - printk("Error %d while requesting firmware %s \n", | |
733 | + printk(KERN_ERR "Error %d while requesting firmware %s\n", | |
733 | 734 | rc, fname); |
734 | 735 | |
735 | 736 | return rc; |
... | ... | @@ -738,7 +739,8 @@ |
738 | 739 | endp = p + fw->size; |
739 | 740 | |
740 | 741 | if (fw->size < sizeof(name) - 1 + 2 + 2) { |
741 | - printk("Error: firmware file %s has invalid size!\n", fname); | |
742 | + printk(KERN_ERR "Error: firmware file %s has invalid size!\n", | |
743 | + fname); | |
742 | 744 | goto corrupt; |
743 | 745 | } |
744 | 746 | |
745 | 747 | |
... | ... | @@ -758,9 +760,9 @@ |
758 | 760 | |
759 | 761 | priv->firm = kzalloc(sizeof(*priv->firm) * n_array, GFP_KERNEL); |
760 | 762 | if (priv->firm == NULL) { |
761 | - printk("Not enough memory to load firmware file.\n"); | |
763 | + printk(KERN_ERR "Not enough memory to load firmware file.\n"); | |
762 | 764 | rc = -ENOMEM; |
763 | - goto err; | |
765 | + goto done; | |
764 | 766 | } |
765 | 767 | priv->firm_size = n_array; |
766 | 768 | |
... | ... | @@ -772,7 +774,7 @@ |
772 | 774 | |
773 | 775 | n++; |
774 | 776 | if (n >= n_array) { |
775 | - printk("More firmware images in file than " | |
777 | + printk(KERN_ERR "More firmware images in file than " | |
776 | 778 | "were expected!\n"); |
777 | 779 | goto corrupt; |
778 | 780 | } |
... | ... | @@ -798,8 +800,7 @@ |
798 | 800 | p += sizeof(size); |
799 | 801 | |
800 | 802 | if (!size || size > endp - p) { |
801 | - printk("Firmware type (%x), id %llx is corrupted " | |
802 | - "(size=%d, expected %d)\n", | |
803 | + printk(KERN_ERR "Firmware type (%x), id %llx is corrupted (size=%d, expected %d)\n", | |
803 | 804 | type, (unsigned long long)id, |
804 | 805 | (unsigned)(endp - p), size); |
805 | 806 | goto corrupt; |
806 | 807 | |
807 | 808 | |
808 | 809 | |
... | ... | @@ -807,15 +808,15 @@ |
807 | 808 | |
808 | 809 | priv->firm[n].ptr = kzalloc(size, GFP_KERNEL); |
809 | 810 | if (priv->firm[n].ptr == NULL) { |
810 | - printk("Not enough memory to load firmware file.\n"); | |
811 | + printk(KERN_ERR "Not enough memory to load firmware file.\n"); | |
811 | 812 | rc = -ENOMEM; |
812 | - goto err; | |
813 | + goto done; | |
813 | 814 | } |
814 | 815 | |
815 | 816 | if (debug) { |
816 | - printk("Reading firmware type "); | |
817 | + printk(KERN_DEBUG "Reading firmware type "); | |
817 | 818 | dump_firm_type_and_int_freq(type, int_freq); |
818 | - printk("(%x), id %llx, size=%d.\n", | |
819 | + printk(KERN_DEBUG "(%x), id %llx, size=%d.\n", | |
819 | 820 | type, (unsigned long long)id, size); |
820 | 821 | } |
821 | 822 | |
822 | 823 | |
823 | 824 | |
824 | 825 | |
... | ... | @@ -829,21 +830,18 @@ |
829 | 830 | } |
830 | 831 | |
831 | 832 | if (n + 1 != priv->firm_size) { |
832 | - printk("Firmware file is incomplete!\n"); | |
833 | + printk(KERN_ERR "Firmware file is incomplete!\n"); | |
833 | 834 | goto corrupt; |
834 | 835 | } |
835 | 836 | |
836 | 837 | goto done; |
837 | 838 | |
838 | 839 | header: |
839 | - printk("Firmware header is incomplete!\n"); | |
840 | + printk(KERN_ERR "Firmware header is incomplete!\n"); | |
840 | 841 | corrupt: |
841 | 842 | rc = -EINVAL; |
842 | - printk("Error: firmware file is corrupted!\n"); | |
843 | + printk(KERN_ERR "Error: firmware file is corrupted!\n"); | |
843 | 844 | |
844 | -err: | |
845 | - printk("Releasing partially loaded firmware file.\n"); | |
846 | - | |
847 | 845 | done: |
848 | 846 | release_firmware(fw); |
849 | 847 | if (rc == 0) |
... | ... | @@ -883,11 +881,13 @@ |
883 | 881 | return -EINVAL; |
884 | 882 | p += 12 * scode; |
885 | 883 | |
886 | - tuner_info("Loading SCODE for type="); | |
887 | - dump_firm_type_and_int_freq(priv->firm[pos].type, | |
888 | - priv->firm[pos].int_freq); | |
889 | - printk("(%x), id %016llx.\n", priv->firm[pos].type, | |
890 | - (unsigned long long)*id); | |
884 | + if (debug) { | |
885 | + tuner_info("Loading SCODE for type="); | |
886 | + dump_firm_type_and_int_freq(priv->firm[pos].type, | |
887 | + priv->firm[pos].int_freq); | |
888 | + printk(KERN_CONT "(%x), id %016llx.\n", priv->firm[pos].type, | |
889 | + (unsigned long long)*id); | |
890 | + } | |
891 | 891 | |
892 | 892 | scode_buf[0] = 0x00; |
893 | 893 | memcpy(&scode_buf[1], p, 12); |
... | ... | @@ -895,7 +895,7 @@ |
895 | 895 | /* Enter direct-mode */ |
896 | 896 | rc = xc_write_reg(priv, XREG_DIRECTSITTING_MODE, 0); |
897 | 897 | if (rc < 0) { |
898 | - printk("failed to put device into direct mode!\n"); | |
898 | + printk(KERN_ERR "failed to put device into direct mode!\n"); | |
899 | 899 | return -EIO; |
900 | 900 | } |
901 | 901 | |
... | ... | @@ -903,7 +903,7 @@ |
903 | 903 | if (rc != 0) { |
904 | 904 | /* Even if the send failed, make sure we set back to indirect |
905 | 905 | mode */ |
906 | - printk("Failed to set scode %d\n", rc); | |
906 | + printk(KERN_ERR "Failed to set scode %d\n", rc); | |
907 | 907 | } |
908 | 908 | |
909 | 909 | /* Switch back to indirect-mode */ |
... | ... | @@ -944,7 +944,7 @@ |
944 | 944 | dprintk(1, "checking firmware, user requested type="); |
945 | 945 | if (debug) { |
946 | 946 | dump_firm_type(new_fw.type); |
947 | - printk("(%x), id %016llx, ", new_fw.type, | |
947 | + printk(KERN_CONT "(%x), id %016llx, ", new_fw.type, | |
948 | 948 | (unsigned long long)new_fw.std_req); |
949 | 949 | if (!int_freq) |
950 | 950 | printk(KERN_CONT "scode_tbl "); |
... | ... | @@ -971,7 +971,7 @@ |
971 | 971 | std0 = 0; |
972 | 972 | rc = load_firmware(fe, BASE, &std0); |
973 | 973 | if (rc < 0) { |
974 | - printk("Error %d while loading base firmware\n", rc); | |
974 | + printk(KERN_ERR "Error %d while loading base firmware\n", rc); | |
975 | 975 | goto fail; |
976 | 976 | } |
977 | 977 | |
... | ... | @@ -1025,7 +1025,7 @@ |
1025 | 1025 | |
1026 | 1026 | if (xc_get_version(priv, &hw_major, &hw_minor, &fw_major, |
1027 | 1027 | &fw_minor) != 0) { |
1028 | - printk("Unable to read tuner registers.\n"); | |
1028 | + printk(KERN_ERR "Unable to read tuner registers.\n"); | |
1029 | 1029 | goto fail; |
1030 | 1030 | } |
1031 | 1031 | |
1032 | 1032 | |
1033 | 1033 | |
... | ... | @@ -1340,11 +1340,10 @@ |
1340 | 1340 | if (params->std & V4L2_STD_PAL_I) { |
1341 | 1341 | /* default to NICAM audio standard */ |
1342 | 1342 | params->std = V4L2_STD_PAL_I | V4L2_STD_NICAM; |
1343 | - if (audio_std & XC4000_AUDIO_STD_MONO) { | |
1343 | + if (audio_std & XC4000_AUDIO_STD_MONO) | |
1344 | 1344 | priv->video_standard = XC4000_I_PAL_NICAM_MONO; |
1345 | - } else { | |
1345 | + else | |
1346 | 1346 | priv->video_standard = XC4000_I_PAL_NICAM; |
1347 | - } | |
1348 | 1347 | goto tune_channel; |
1349 | 1348 | } |
1350 | 1349 |
drivers/media/common/tuners/xc4000.h
... | ... | @@ -50,8 +50,7 @@ |
50 | 50 | * it's passed back to a bridge during tuner_callback(). |
51 | 51 | */ |
52 | 52 | |
53 | -#if defined(CONFIG_MEDIA_TUNER_XC4000) || \ | |
54 | - (defined(CONFIG_MEDIA_TUNER_XC4000_MODULE) && defined(MODULE)) | |
53 | +#if defined(CONFIG_MEDIA_TUNER_XC4000) || (defined(CONFIG_MEDIA_TUNER_XC4000_MODULE) && defined(MODULE)) | |
55 | 54 | extern struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe, |
56 | 55 | struct i2c_adapter *i2c, |
57 | 56 | struct xc4000_config *cfg); |
drivers/media/dvb/dvb-usb/dib0700_devices.c
... | ... | @@ -2794,7 +2794,7 @@ |
2794 | 2794 | tun_i2c = dib7000p_get_i2c_master(adap->fe, |
2795 | 2795 | DIBX000_I2C_INTERFACE_TUNER, 1); |
2796 | 2796 | if (tun_i2c == NULL) { |
2797 | - printk("Could not reach tuner i2c bus\n"); | |
2797 | + printk(KERN_ERR "Could not reach tuner i2c bus\n"); | |
2798 | 2798 | return 0; |
2799 | 2799 | } |
2800 | 2800 |