From patchwork Thu Jan 12 01:31:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaejoong Kim X-Patchwork-Id: 9511717 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 D1D3160710 for ; Thu, 12 Jan 2017 01:32:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3DA728638 for ; Thu, 12 Jan 2017 01:32:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4B4A2865F; Thu, 12 Jan 2017 01:32:33 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 4E3E728638 for ; Thu, 12 Jan 2017 01:32:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762764AbdALBcb (ORCPT ); Wed, 11 Jan 2017 20:32:31 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:34067 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762745AbdALBca (ORCPT ); Wed, 11 Jan 2017 20:32:30 -0500 Received: by mail-pf0-f193.google.com with SMTP id y143so787776pfb.1 for ; Wed, 11 Jan 2017 17:32:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=yyHo3CFjQIHSvW1tfHZyN0imsULh1Xu5EvYOPd39nAI=; b=raIIAr8ZMsUwUMvD1oqXiq4mNPtV9q4YeAYpKVVj+yWELd+KUxIjFH2jKxRz1ct1TY 5jiKYDRKoITQj417c8GoPE0aHw5QLZngBYgdaexHWjcXAvuvzFNn+oj3+5yshkbCyVmt h8f/latxbrlFkTvjq6BT4bBd0rY/dnOJPlZLYpn+11B7zvW3262HBmd4CgtG/0TrWPGj kqG5bK8gNs+4gRkGU0Mte46xQ1suLo3t125zY+qBdA6cW/yM0eaanqNKsF4TPfVR8xbi a4G7JQbBauqZI+eT7WKVSgw7rSS4xHIHL6orWbHSIYfFMarMpLs+NDVeHUex/WY916xW wcug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yyHo3CFjQIHSvW1tfHZyN0imsULh1Xu5EvYOPd39nAI=; b=KN09f3akFk795qt60xYi6nTjXdIz4KgldtQ+2FT+Ts4C7qzKT1kw0HhnUbIkvBW+da q8ksZfTaR3hFeUDq+bmNouN7QeE8W09UDSermB8LWA6qEwULHyESMERRxMtCqzGlIRvc RdIIH3Y9AvOwZIPTCAQF92bekDmpn1Fl2p61F870mS4Phf/fwoPSM8n4Y7PzgKO/qCjK ZFgoorpvEIWbUo/pLnnmOp3ZLAM18TQ7IDps5JGUk+UnRBf5ddD/kClr6gemQM8adBEo ZJdiZmZ4N7WB4BGJEPrfwf2vuopHFpO+oE33F9n89sdABiAzAGC4VBgt1xXq/DL3eHsl 2BKg== X-Gm-Message-State: AIkVDXLx/Fj0TU/ItOBQme0eNkCmOBZiEciV9G5ftsL3xyMD9q9knW79/XQexa1lHVNc8Q== X-Received: by 10.84.211.137 with SMTP id c9mr17326837pli.8.1484184750234; Wed, 11 Jan 2017 17:32:30 -0800 (PST) Received: from localhost.localdomain ([27.122.242.72]) by smtp.gmail.com with ESMTPSA id k78sm16495496pfb.93.2017.01.11.17.32.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Jan 2017 17:32:29 -0800 (PST) From: Jaejoong Kim To: laurent.pinchart@ideasonboard.com Cc: linux-media@vger.kernel.org, Jaejoong Kim Subject: [PATCH] [media] uvcvideo: change result code of debugfs_init to void Date: Thu, 12 Jan 2017 10:31:21 +0900 Message-Id: <1484184681-27384-1-git-send-email-climbbb.kim@gmail.com> X-Mailer: git-send-email 2.7.4 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 The device driver should keep going even if debugfs initialization fails. So, change the return type to void. Signed-off-by: Jaejoong Kim Reviewed-by: Laurent Pinchart --- drivers/media/usb/uvc/uvc_debugfs.c | 15 ++++++--------- drivers/media/usb/uvc/uvcvideo.h | 4 ++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_debugfs.c b/drivers/media/usb/uvc/uvc_debugfs.c index 14561a5..368f8f8 100644 --- a/drivers/media/usb/uvc/uvc_debugfs.c +++ b/drivers/media/usb/uvc/uvc_debugfs.c @@ -75,14 +75,14 @@ static const struct file_operations uvc_debugfs_stats_fops = { static struct dentry *uvc_debugfs_root_dir; -int uvc_debugfs_init_stream(struct uvc_streaming *stream) +void uvc_debugfs_init_stream(struct uvc_streaming *stream) { struct usb_device *udev = stream->dev->udev; struct dentry *dent; char dir_name[32]; if (uvc_debugfs_root_dir == NULL) - return -ENODEV; + return; sprintf(dir_name, "%u-%u", udev->bus->busnum, udev->devnum); @@ -90,7 +90,7 @@ int uvc_debugfs_init_stream(struct uvc_streaming *stream) if (IS_ERR_OR_NULL(dent)) { uvc_printk(KERN_INFO, "Unable to create debugfs %s " "directory.\n", dir_name); - return -ENODEV; + return; } stream->debugfs_dir = dent; @@ -100,10 +100,8 @@ int uvc_debugfs_init_stream(struct uvc_streaming *stream) if (IS_ERR_OR_NULL(dent)) { uvc_printk(KERN_INFO, "Unable to create debugfs stats file.\n"); uvc_debugfs_cleanup_stream(stream); - return -ENODEV; + return; } - - return 0; } void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream) @@ -115,18 +113,17 @@ void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream) stream->debugfs_dir = NULL; } -int uvc_debugfs_init(void) +void uvc_debugfs_init(void) { struct dentry *dir; dir = debugfs_create_dir("uvcvideo", usb_debug_root); if (IS_ERR_OR_NULL(dir)) { uvc_printk(KERN_INFO, "Unable to create debugfs directory\n"); - return -ENODATA; + return; } uvc_debugfs_root_dir = dir; - return 0; } void uvc_debugfs_cleanup(void) diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index 7e4d3ee..1d1b992 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -745,9 +745,9 @@ void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream, struct uvc_buffer *buf); /* debugfs and statistics */ -int uvc_debugfs_init(void); +void uvc_debugfs_init(void); void uvc_debugfs_cleanup(void); -int uvc_debugfs_init_stream(struct uvc_streaming *stream); +void uvc_debugfs_init_stream(struct uvc_streaming *stream); void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream); size_t uvc_video_stats_dump(struct uvc_streaming *stream, char *buf,