From patchwork Wed Dec 12 08:58:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1865091 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 562E0E01CA for ; Wed, 12 Dec 2012 09:06:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752238Ab2LLJGV (ORCPT ); Wed, 12 Dec 2012 04:06:21 -0500 Received: from mail-pa0-f46.google.com ([209.85.220.46]:36651 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752696Ab2LLJFS (ORCPT ); Wed, 12 Dec 2012 04:05:18 -0500 Received: by mail-pa0-f46.google.com with SMTP id bh2so403167pad.19 for ; Wed, 12 Dec 2012 01:05:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=drg62kXb7cqtLeDSYec51GciqixgVe37wc9foDP1fWc=; b=LXC4wIWOt1/PYXXtWP2COlr3VW+fGVCTs0hfWJRzfWjssvLa1qbzqz3HoPA0a0NUtf oU/trfJ1E+RMFYnLgz8J7dvWwb/0ltb4weMRlC4J1xiud4dW7OxQ8RoTZDsHKdX7Jpb5 JNG9Fg4GPh+Ixck2G2gocGet+SqdPqVNGJ1pl+AEhT3A20HK2LYjkqsjiZMlQd7juR6F OcVePeLed9IQ5eqDKZUNQig/6easIO/sM0FP06DVx7/EPxoNlSipgvVMMSgOW9fJ1SSE VNe8rxM1PqKxEDNHzma50rITb8AVyfoRwvgunicY587n+fTjoahBtjlDerNNXcF9jAP5 +q0w== Received: by 10.68.212.106 with SMTP id nj10mr845010pbc.101.1355303117754; Wed, 12 Dec 2012 01:05:17 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id mn5sm15338266pbc.12.2012.12.12.01.05.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 01:05:16 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: hdegoede@redhat.com, mchehab@redhat.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 1/1] gspca: Use module_usb_driver macro Date: Wed, 12 Dec 2012 14:28:12 +0530 Message-Id: <1355302692-28475-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnuFs063Det6668h46o2IEEyRTEIX81jN19xk+FgcRhb1vr5xbwlLqIXeX/v8f0fuE939r5 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org module_usb_driver eliminates a lot of boilerplate by replacing module_init() and module_exit() calls. Signed-off-by: Sachin Kamat --- Compile tested with linux-next --- drivers/media/usb/gspca/jl2005bcd.c | 18 +----------------- 1 files changed, 1 insertions(+), 17 deletions(-) diff --git a/drivers/media/usb/gspca/jl2005bcd.c b/drivers/media/usb/gspca/jl2005bcd.c index 62ba80d..fdaeeb1 100644 --- a/drivers/media/usb/gspca/jl2005bcd.c +++ b/drivers/media/usb/gspca/jl2005bcd.c @@ -536,20 +536,4 @@ static struct usb_driver sd_driver = { #endif }; -/* -- module insert / remove -- */ -static int __init sd_mod_init(void) -{ - int ret; - - ret = usb_register(&sd_driver); - if (ret < 0) - return ret; - return 0; -} -static void __exit sd_mod_exit(void) -{ - usb_deregister(&sd_driver); -} - -module_init(sd_mod_init); -module_exit(sd_mod_exit); +module_usb_driver(sd_driver);