From patchwork Wed Nov 16 21:45:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 9432793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 00C1A60471 for ; Wed, 16 Nov 2016 21:45:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E159F2915D for ; Wed, 16 Nov 2016 21:45:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D217629167; Wed, 16 Nov 2016 21:45:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C5B42915D for ; Wed, 16 Nov 2016 21:45:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 72AEC6E7CC; Wed, 16 Nov 2016 21:45:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4DA626E7CC for ; Wed, 16 Nov 2016 21:45:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F4C5202F8; Wed, 16 Nov 2016 21:45:25 +0000 (UTC) Received: from localhost (unknown [69.71.4.155]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 08611203B6; Wed, 16 Nov 2016 21:45:23 +0000 (UTC) Subject: [PATCH] vgaarb: Use dev_printk() when possible From: Bjorn Helgaas To: David Airlie Date: Wed, 16 Nov 2016 15:45:22 -0600 Message-ID: <20161116214522.12138.50745.stgit@bhelgaas-glaptop.roam.corp.google.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP Cc: Daniel Vetter , Thierry Reding , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP For consistency with other device-related messages, use dev_printk() when possible instead of pr_*() and pci_name(). This changes messages like this: vgaarb: setting as boot device: PCI:0000:01:00.0 vgaarb: device added: PCI:0000:01:00.0,decodes=io+mem,owns=io+mem,locks=none vgaarb: bridge control possible 0000:01:00.0 to this: pci 0000:01:00.0: vgaarb: setting as boot device pci 0000:01:00.0: vgaarb: device added: decodes=io+mem,owns=io+mem,locks=none pci 0000:01:00.0: vgaarb: bridge control possible No functional change intended. Signed-off-by: Bjorn Helgaas --- drivers/gpu/vga/vgaarb.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c index 1887f19..8a3f212 100644 --- a/drivers/gpu/vga/vgaarb.c +++ b/drivers/gpu/vga/vgaarb.c @@ -29,7 +29,8 @@ * */ -#define pr_fmt(fmt) "vgaarb: " fmt +#define DRV "vgaarb: " +#define pr_fmt(fmt) DRV fmt #include #include @@ -663,7 +664,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) */ if (vga_default == NULL && ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) { - pr_info("setting as boot device: PCI:%s\n", pci_name(pdev)); + dev_info(&pdev->dev, DRV "setting as boot device\n"); vga_set_default_device(pdev); } @@ -672,8 +673,7 @@ static bool vga_arbiter_add_pci_device(struct pci_dev *pdev) /* Add to the list */ list_add(&vgadev->list, &vga_list); vga_count++; - pr_info("device added: PCI:%s,decodes=%s,owns=%s,locks=%s\n", - pci_name(pdev), + dev_info(&pdev->dev, DRV "device added: decodes=%s,owns=%s,locks=%s\n", vga_iostate_to_str(vgadev->decodes), vga_iostate_to_str(vgadev->owns), vga_iostate_to_str(vgadev->locks)); @@ -732,8 +732,7 @@ static inline void vga_update_device_decodes(struct vga_device *vgadev, decodes_unlocked = vgadev->locks & decodes_removed; vgadev->decodes = new_decodes; - pr_info("device changed decodes: PCI:%s,olddecodes=%s,decodes=%s:owns=%s\n", - pci_name(vgadev->pdev), + dev_info(&vgadev->pdev->dev, DRV "device changed decodes: olddecodes=%s,decodes=%s:owns=%s\n", vga_iostate_to_str(old_decodes), vga_iostate_to_str(vgadev->decodes), vga_iostate_to_str(vgadev->owns)); @@ -1206,7 +1205,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user *buf, pr_debug("vgadev %p\n", vgadev); if (vgadev == NULL) { if (pdev) { - pr_err("this pci device is not a vga device\n"); + dev_err(&pdev->dev, DRV "this device is not a vga device\n"); pci_dev_put(pdev); } @@ -1408,6 +1407,7 @@ static int __init vga_arb_device_init(void) int rc; struct pci_dev *pdev; struct vga_device *vgadev; + struct device *dev; rc = misc_register(&vga_arb_device); if (rc < 0) @@ -1440,6 +1440,7 @@ static int __init vga_arb_device_init(void) int i; limit = screen_info.lfb_base + screen_info.lfb_size; + dev = &vgadev->pdev->dev; /* Does firmware framebuffer belong to us? */ for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) { @@ -1458,20 +1459,16 @@ static int __init vga_arb_device_init(void) continue; if (!vga_default_device()) - pr_info("setting as boot device: PCI:%s\n", - pci_name(vgadev->pdev)); + dev_info(dev, DRV "setting as boot device\n"); else if (vgadev->pdev != vga_default_device()) - pr_info("overriding boot device: PCI:%s\n", - pci_name(vgadev->pdev)); + dev_info(dev, DRV "overriding boot device\n"); vga_set_default_device(vgadev->pdev); } #endif if (vgadev->bridge_has_one_vga) - pr_info("bridge control possible %s\n", - pci_name(vgadev->pdev)); + dev_info(dev, DRV "bridge control possible\n"); else - pr_info("no bridge control possible %s\n", - pci_name(vgadev->pdev)); + dev_info(dev, DRV "no bridge control possible\n"); } return rc; }