Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: gpib: Use dev_xxx for messaging

Change pr_xxx to dev_xxx

Signed-off-by: Dave Penkler <dpenkler@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20241104175014.12317-8-dpenkler@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dave Penkler and committed by
Greg Kroah-Hartman
45f48013 93b17a59

+42 -28
+42 -28
drivers/staging/gpib/agilent_82350b/agilent_82350b.c
··· 52 52 retval = tms9914_read(board, tms_priv, buffer, 1, end, &num_bytes); 53 53 *bytes_read += num_bytes; 54 54 if (retval < 0) 55 - pr_err("%s: tms9914_read failed retval=%i\n", driver_name, retval); 55 + dev_err(board->gpib_dev, "%s: tms9914_read failed retval=%i\n", 56 + driver_name, retval); 56 57 if (retval < 0 || *end) 57 58 return retval; 58 59 ++buffer; ··· 89 88 test_bit(DEV_CLEAR_BN, &tms_priv->state) || 90 89 test_bit(TIMO_NUM, &board->status)); 91 90 if (retval) { 92 - pr_err("%s: read wait interrupted\n", driver_name); 91 + dev_dbg(board->gpib_dev, "%s: read wait interrupted\n", driver_name); 93 92 retval = -ERESTARTSYS; 94 93 break; 95 94 } ··· 103 102 *end = 1; 104 103 } 105 104 if (test_bit(TIMO_NUM, &board->status)) { 106 - pr_err("%s: minor %i: read timed out\n", driver_name, board->minor); 105 + dev_err(board->gpib_dev, "%s: read timed out\n", driver_name); 107 106 retval = -ETIMEDOUT; 108 107 break; 109 108 } 110 109 if (test_bit(DEV_CLEAR_BN, &tms_priv->state)) { 111 - pr_err("%s: device clear interrupted read\n", driver_name); 110 + dev_err(board->gpib_dev, "%s: device clear interrupted read\n", 111 + driver_name); 112 112 retval = -EINTR; 113 113 break; 114 114 } ··· 140 138 struct tms9914_priv *tms_priv = &a_priv->tms9914_priv; 141 139 142 140 if (retval) { 143 - pr_err("%s: write wait interrupted\n", driver_name); 141 + dev_err(board->gpib_dev, "%s: write wait interrupted\n", driver_name); 144 142 return -ERESTARTSYS; 145 143 } 146 144 if (test_bit(TIMO_NUM, &board->status)) { 147 - pr_err("%s: minor %i: write timed out\n", driver_name, board->minor); 145 + dev_err(board->gpib_dev, "%s: write timed out\n", driver_name); 148 146 return -ETIMEDOUT; 149 147 } 150 148 if (test_bit(DEV_CLEAR_BN, &tms_priv->state)) { 151 - pr_err("%s: device clear interrupted write\n", driver_name); 149 + dev_err(board->gpib_dev, "%s: device clear interrupted write\n", driver_name); 152 150 return -EINTR; 153 151 } 154 152 return 0; ··· 560 558 return 0; 561 559 // need to programme borg 562 560 if (!config->init_data || config->init_data_length != firmware_length) { 563 - pr_err("%s: the 82350A board requires firmware after powering on.\n", driver_name); 561 + dev_err(board->gpib_dev, "%s: the 82350A board requires firmware after powering on.\n", 562 + driver_name); 564 563 return -EIO; 565 564 } 566 - pr_info("%s: Loading firmware...\n", driver_name); 565 + dev_info(board->gpib_dev, "%s: Loading firmware...\n", driver_name); 567 566 568 567 // tickle the borg 569 568 writel(plx_cntrl_static_bits | PLX9050_USER3_DATA_BIT, ··· 583 580 usleep_range(10, 20); 584 581 } 585 582 if (j == timeout) { 586 - pr_err("%s: timed out loading firmware.\n", driver_name); 583 + dev_err(board->gpib_dev, "%s: timed out loading firmware.\n", driver_name); 587 584 return -ETIMEDOUT; 588 585 } 589 586 writeb(firmware_data[i], a_priv->gpib_base + CONFIG_DATA_REG); ··· 594 591 usleep_range(10, 20); 595 592 } 596 593 if (j == timeout) { 597 - pr_err("%s: timed out waiting for firmware load to complete.\n", driver_name); 594 + dev_err(board->gpib_dev, "%s: timed out waiting for firmware load to complete.\n", 595 + driver_name); 598 596 return -ETIMEDOUT; 599 597 } 600 - pr_info("%s: ...done.\n", driver_name); 598 + dev_info(board->gpib_dev, "%s: ...done.\n", driver_name); 601 599 return 0; 602 600 } 603 601 ··· 620 616 unsigned int read_value = readb(a_priv->sram_base + i); 621 617 622 618 if ((i & byte_mask) != read_value) { 623 - pr_err("%s: SRAM test failed at %d wanted %d got %d\n", 624 - driver_name, i, (i & byte_mask), read_value); 619 + dev_err(board->gpib_dev, "%s: SRAM test failed at %d wanted %d got %d\n", 620 + driver_name, i, (i & byte_mask), read_value); 625 621 return -EIO; 626 622 } 627 623 if (need_resched()) 628 624 schedule(); 629 625 } 630 - pr_info("%s: SRAM test passed 0x%x bytes checked\n", driver_name, sram_length); 626 + dev_info(board->gpib_dev, "%s: SRAM test passed 0x%x bytes checked\n", 627 + driver_name, sram_length); 631 628 return 0; 632 629 } 633 630 ··· 656 651 PCI_DEVICE_ID_82350B, NULL); 657 652 if (a_priv->pci_device) { 658 653 a_priv->model = MODEL_82350B; 659 - pr_info("%s: Agilent 82350B board found\n", driver_name); 654 + dev_info(board->gpib_dev, "%s: Agilent 82350B board found\n", driver_name); 660 655 661 656 } else { 662 657 a_priv->pci_device = gpib_pci_get_device(config, PCI_VENDOR_ID_AGILENT, 663 658 PCI_DEVICE_ID_82351A, NULL); 664 659 if (a_priv->pci_device) { 665 660 a_priv->model = MODEL_82351A; 666 - pr_info("%s: Agilent 82351B board found\n", driver_name); 661 + dev_info(board->gpib_dev, "%s: Agilent 82351B board found\n", driver_name); 667 662 668 663 } else { 669 664 a_priv->pci_device = gpib_pci_get_subsys(config, PCI_VENDOR_ID_PLX, ··· 673 668 a_priv->pci_device); 674 669 if (a_priv->pci_device) { 675 670 a_priv->model = MODEL_82350A; 676 - pr_info("%s: HP/Agilent 82350A board found\n", driver_name); 671 + dev_info(board->gpib_dev, "%s: HP/Agilent 82350A board found\n", 672 + driver_name); 677 673 } else { 678 - pr_err("%s: no 82350/82351 board found\n", driver_name); 674 + dev_err(board->gpib_dev, "%s: no 82350/82351 board found\n", 675 + driver_name); 679 676 return -ENODEV; 680 677 } 681 678 } 682 679 } 683 680 if (pci_enable_device(a_priv->pci_device)) { 684 - pr_err("%s: error enabling pci device\n", driver_name); 681 + dev_err(board->gpib_dev, "%s: error enabling pci device\n", driver_name); 685 682 return -EIO; 686 683 } 687 684 if (pci_request_regions(a_priv->pci_device, driver_name)) ··· 692 685 case MODEL_82350A: 693 686 a_priv->plx_base = ioremap(pci_resource_start(a_priv->pci_device, PLX_MEM_REGION), 694 687 pci_resource_len(a_priv->pci_device, PLX_MEM_REGION)); 695 - pr_info("%s: plx base address remapped to 0x%p\n", driver_name, a_priv->plx_base); 688 + dev_dbg(board->gpib_dev, "%s: plx base address remapped to 0x%p\n", 689 + driver_name, a_priv->plx_base); 696 690 a_priv->gpib_base = ioremap(pci_resource_start(a_priv->pci_device, 697 691 GPIB_82350A_REGION), 698 692 pci_resource_len(a_priv->pci_device, 699 693 GPIB_82350A_REGION)); 700 - pr_info("%s: gpib base address remapped to 0x%p\n", driver_name, a_priv->gpib_base); 694 + dev_dbg(board->gpib_dev, "%s: gpib base address remapped to 0x%p\n", 695 + driver_name, a_priv->gpib_base); 701 696 tms_priv->iobase = a_priv->gpib_base + TMS9914_BASE_REG; 702 697 a_priv->sram_base = ioremap(pci_resource_start(a_priv->pci_device, 703 698 SRAM_82350A_REGION), 704 699 pci_resource_len(a_priv->pci_device, 705 700 SRAM_82350A_REGION)); 706 - pr_info("%s: sram base address remapped to 0x%p\n", driver_name, a_priv->sram_base); 701 + dev_dbg(board->gpib_dev, "%s: sram base address remapped to 0x%p\n", 702 + driver_name, a_priv->sram_base); 707 703 a_priv->borg_base = ioremap(pci_resource_start(a_priv->pci_device, 708 704 BORG_82350A_REGION), 709 705 pci_resource_len(a_priv->pci_device, 710 706 BORG_82350A_REGION)); 711 - pr_info("%s: borg base address remapped to 0x%p\n", driver_name, a_priv->borg_base); 707 + dev_dbg(board->gpib_dev, "%s: borg base address remapped to 0x%p\n", 708 + driver_name, a_priv->borg_base); 712 709 713 710 retval = init_82350a_hardware(board, config); 714 711 if (retval < 0) ··· 722 711 case MODEL_82351A: 723 712 a_priv->gpib_base = ioremap(pci_resource_start(a_priv->pci_device, GPIB_REGION), 724 713 pci_resource_len(a_priv->pci_device, GPIB_REGION)); 725 - pr_info("%s: gpib base address remapped to 0x%p\n", driver_name, a_priv->gpib_base); 714 + dev_dbg(board->gpib_dev, "%s: gpib base address remapped to 0x%p\n", 715 + driver_name, a_priv->gpib_base); 726 716 tms_priv->iobase = a_priv->gpib_base + TMS9914_BASE_REG; 727 717 a_priv->sram_base = ioremap(pci_resource_start(a_priv->pci_device, SRAM_REGION), 728 718 pci_resource_len(a_priv->pci_device, SRAM_REGION)); 729 - pr_info("%s: sram base address remapped to 0x%p\n", driver_name, a_priv->sram_base); 719 + dev_dbg(board->gpib_dev, "%s: sram base address remapped to 0x%p\n", 720 + driver_name, a_priv->sram_base); 730 721 a_priv->misc_base = ioremap(pci_resource_start(a_priv->pci_device, MISC_REGION), 731 722 pci_resource_len(a_priv->pci_device, MISC_REGION)); 732 - pr_info("%s: misc base address remapped to 0x%p\n", driver_name, a_priv->misc_base); 723 + dev_dbg(board->gpib_dev, "%s: misc base address remapped to 0x%p\n", 724 + driver_name, a_priv->misc_base); 733 725 break; 734 726 default: 735 727 pr_err("%s: invalid board\n", driver_name); ··· 749 735 return -EIO; 750 736 } 751 737 a_priv->irq = a_priv->pci_device->irq; 752 - pr_info("%s: IRQ %d\n", driver_name, a_priv->irq); 738 + dev_dbg(board->gpib_dev, "%s: IRQ %d\n", driver_name, a_priv->irq); 753 739 754 740 writeb(0, a_priv->gpib_base + SRAM_ACCESS_CONTROL_REG); 755 741 a_priv->card_mode_bits = ENABLE_PCI_IRQ_BIT;