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: 13490 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C2B7B23FCD for ; Wed, 12 Dec 2012 09:05:19 +0000 (UTC) Received: from mail-ia0-f172.google.com (mail-ia0-f172.google.com [209.85.210.172]) by fiordland.canonical.com (Postfix) with ESMTP id 6983DA192BB for ; Wed, 12 Dec 2012 09:05:19 +0000 (UTC) Received: by mail-ia0-f172.google.com with SMTP id z13so676941iaz.3 for ; Wed, 12 Dec 2012 01:05:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=drg62kXb7cqtLeDSYec51GciqixgVe37wc9foDP1fWc=; b=C728aQvomKfm7z7imETEp8HIK4DWDVVfT7YFleDi5IyWNiuub/5FB/apR3bXzOVHqO 8mUyQpyKgbb7V2evWBV5utAij6zHWzsR3eN81y3OWQqcbqHjpQ6SOL3RIwLXzwP9n1zr XZleI+YMgv5MSTbsG2qhGIIWffIExNUJ1eDhxNfNZI6x/b3JYkJ6oAdvXTF2vBizygyS fp2Bh8dAW1uBNecbEneLzXTuiwW8cSPpCuuqPBZLZ1zqmRQQymF95+bm3OAL+WqKQLL8 OWqLBn5la8WP6Yv/USg4ETB7i+NPUnqD2UQS7wtQ1TjfArpyVSRmaEOUikRPzYEbEnC+ /m8w== Received: by 10.50.42.168 with SMTP id p8mr12571521igl.57.1355303118861; Wed, 12 Dec 2012 01:05:18 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp186519igt; Wed, 12 Dec 2012 01:05:18 -0800 (PST) Received: by 10.68.247.134 with SMTP id ye6mr836143pbc.69.1355303118255; Wed, 12 Dec 2012 01:05:18 -0800 (PST) Received: from mail-da0-f41.google.com (mail-da0-f41.google.com [209.85.210.41]) by mx.google.com with ESMTPS id wk7si4674155pbc.109.2012.12.12.01.05.17 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 12 Dec 2012 01:05:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.41 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.41 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-da0-f41.google.com with SMTP id e20so168021dak.0 for ; Wed, 12 Dec 2012 01:05:17 -0800 (PST) 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: ALoCoQkNkQGtaBRvruRGSEGRlfkpbtzqNJR1+d1cHELGINwC47dXarmPAI/yULdex7cljPUSy4WN 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);