From patchwork Thu Sep 21 15:09:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9964111 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 2B2A2600C5 for ; Thu, 21 Sep 2017 15:11:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 271B029741 for ; Thu, 21 Sep 2017 15:11:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 257842973D; Thu, 21 Sep 2017 15:11:57 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4266729769 for ; Thu, 21 Sep 2017 15:11:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751821AbdIUPKg (ORCPT ); Thu, 21 Sep 2017 11:10:36 -0400 Received: from mout.web.de ([212.227.17.11]:50796 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751629AbdIUPKf (ORCPT ); Thu, 21 Sep 2017 11:10:35 -0400 Received: from [192.168.1.2] ([78.49.37.140]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MV4TZ-1dtd0K1aSj-00YRh2; Thu, 21 Sep 2017 17:09:41 +0200 Subject: [PATCH 4/4] [media] usbvision-core: Replace four printk() calls by dev_err() From: SF Markus Elfring To: linux-media@vger.kernel.org, Davidlohr Bueso , Hans Verkuil , Mauro Carvalho Chehab , Sakari Ailus Cc: LKML , kernel-janitors@vger.kernel.org References: Message-ID: <0c53a18c-eba1-524b-8825-7454bb8e58a4@users.sourceforge.net> Date: Thu, 21 Sep 2017 17:09:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:j2B9zFtedn2sp2LWhL0Y2GKEZdhVe7EHk0quyuflzHGV5KcOzfW 8oJVD0c4m5OhIMRiHg49G1qJMe69+z0Tpwl92bdrzDWuSaiuNU04YMZh7K7huR97WwSQLaf 5M2qg20mgjZ1rQ4IqX+9fohptRizUh5EpQsOQc42+PZswOAi7ubiXLrIMC+Pyfsbg6X12gE 7heGclq5FVK6pdfVHoTkg== X-UI-Out-Filterresults: notjunk:1; V01:K0:/nbQfCMoolw=:Q+KNV2rFmk05Sdvs83Xi4y AdKOE0b6+/V+8iu+5VnqfgcUVALGOuK9csAgBNP+lNCVQ9G5L0rmN5wuDK4hQZC41iyCwfMxm HKYDWR/jeyNoEPkUZT1O0ft1FCSF1F+u2f/CFQ5fbfjAAA3j11uAnN0515mEJ2WL5g39oJI1F T5NQCDJhA6BkCspH3Wy5xPOo+tOhwdIEcFDJzfbj91y2yKQXI7W/M6taro08jeOq5GnnmMwY8 K8JNvQ4V/bwJJUtz+7oNqer3172Hs6j7Ax+izJcbVRSaIzjcEvW+C9iXTDE1Ds9GlqhdAPM2n NZq4o+jUPKqO0ats3vU7jSReSS2roCmu/uEownJgNigNlLfyVjoMPCqBIgGx9rKgA7xVcmKua 73Zoma5pZXgX6icJQSwpyP331SByFc9za6SpIT2KsveuBlAdZVhEfVOPOJTJWRtHIjN0GJsYu 7Ieci2yGq1GyyC/64tmTo5NHPZunVMC85RrmrvOYnNx8RIesBlEu2/SnjjZPI3eY58QZu5Ncc KnyBa4S61Hqnh62oCinQZQeDH7lIvUXySBInlMjideexh2W8WaUit0yiSebCjjMk8gK9I9Ov3 vGi9DaWljpE1Q50xkC/9svAE8hbk3o9pvnQi5SDsgf5Yz4Cs4fra1ygr1iiLtnq1p6v0v2jAf swt5/C41SWR53VGZDpkDh5A6Y6nJHF0Q1sKft01Gjt4ie/3YPK59raNwjRM1ahPgYnJs5HHli xSzyj0zWWb2W/BSNhLmFPBKrgm1YTb15b1Y8AvcyYNQPtvPn+02zoy40CTpGkITDm9mfJapgp uSkHUe8xFEo+F5BRRt5OpGdM97udUFVchvaKEXHpjgCHo56p4I= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Thu, 21 Sep 2017 16:47:28 +0200 * Replace the local variable "proc" by the identifier "__func__". * Use the interface "dev_err" instead of "printk" in these functions. Signed-off-by: Markus Elfring --- drivers/media/usb/usbvision/usbvision-core.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/media/usb/usbvision/usbvision-core.c b/drivers/media/usb/usbvision/usbvision-core.c index 54db35b03106..2c98805244df 100644 --- a/drivers/media/usb/usbvision/usbvision-core.c +++ b/drivers/media/usb/usbvision/usbvision-core.c @@ -1619,7 +1619,6 @@ static int usbvision_init_webcam(struct usb_usbvision *usbvision) */ static int usbvision_set_video_format(struct usb_usbvision *usbvision, int format) { - static const char proc[] = "usbvision_set_video_format"; unsigned char *value = usbvision->ctrl_urb_buffer; int rc; @@ -1631,8 +1630,9 @@ static int usbvision_set_video_format(struct usb_usbvision *usbvision, int forma if ((format != ISOC_MODE_YUV422) && (format != ISOC_MODE_YUV420) && (format != ISOC_MODE_COMPRESS)) { - printk(KERN_ERR "usbvision: unknown video format %02x, using default YUV420", - format); + dev_err(&usbvision->dev->dev, + "%s: unknown video format %02x, using default YUV420\n", + __func__, format); format = ISOC_MODE_YUV420; } value[0] = 0x0A; /* TODO: See the effect of the filter */ @@ -1643,8 +1643,9 @@ static int usbvision_set_video_format(struct usb_usbvision *usbvision, int forma USB_RECIP_ENDPOINT, 0, (__u16) USBVISION_FILT_CONT, value, 2, HZ); if (rc < 0) - printk(KERN_ERR "%s: ERROR=%d. USBVISION stopped - reconnect or reload driver.\n", - proc, rc); + dev_err(&usbvision->dev->dev, + "%s: ERROR=%d. USBVISION stopped - reconnect or reload driver.\n", + __func__, rc); usbvision->isoc_mode = format; return rc; @@ -2180,7 +2181,8 @@ int usbvision_restart_isoc(struct usb_usbvision *usbvision) int usbvision_audio_off(struct usb_usbvision *usbvision) { if (usbvision_write_reg(usbvision, USBVISION_IOPIN_REG, USBVISION_AUDIO_MUTE) < 0) { - printk(KERN_ERR "usbvision_audio_off: can't write reg\n"); + dev_err(&usbvision->dev->dev, + "%s: can't write reg\n", __func__); return -1; } usbvision->audio_mute = 0; @@ -2192,7 +2194,9 @@ int usbvision_set_audio(struct usb_usbvision *usbvision, int audio_channel) { if (!usbvision->audio_mute) { if (usbvision_write_reg(usbvision, USBVISION_IOPIN_REG, audio_channel) < 0) { - printk(KERN_ERR "usbvision_set_audio: can't write iopin register for audio switching\n"); + dev_err(&usbvision->dev->dev, + "%s: can't write iopin register for audio switching\n", + __func__); return -1; } }