From patchwork Sat Oct 31 23:13:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?TsODwqltZXRoIE3Dg8KhcnRvbg==?= X-Patchwork-Id: 56798 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9VNDUFI029051 for ; Sat, 31 Oct 2009 23:13:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933334AbZJaXNh (ORCPT ); Sat, 31 Oct 2009 19:13:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933333AbZJaXNh (ORCPT ); Sat, 31 Oct 2009 19:13:37 -0400 Received: from mail02d.mail.t-online.hu ([84.2.42.7]:60618 "EHLO mail02d.mail.t-online.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933328AbZJaXNh (ORCPT ); Sat, 31 Oct 2009 19:13:37 -0400 X-Authuid: nmarci Received: from [192.168.1.64] (dsl5402C4D0.pool.t-online.hu [84.2.196.208]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail02d.mail.t-online.hu (Postfix) with ESMTPSA id 41C8875861E; Sun, 1 Nov 2009 00:13:33 +0100 (CET) Message-ID: <4AECC4A0.7080801@freemail.hu> Date: Sun, 01 Nov 2009 00:13:36 +0100 From: =?UTF-8?B?TsOpbWV0aCBNw6FydG9u?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; hu-HU; rv:1.8.1.21) Gecko/20090402 SeaMonkey/1.1.16 MIME-Version: 1.0 To: Jean-Francois Moine , Hans de Goede , V4L Mailing List CC: Thomas Kaiser , Theodore Kilgore , Kyle Guinn Subject: [PATCH 02/21] gspca pac7302/pac7311: separate sd_desc X-DCC-mail.t-online.hu-Metrics: mail02d.mail.t-online.hu 32721; Body=6 Fuz1=6 Fuz2=6 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org diff -uprN b/drivers/media/video/gspca/pac7311.c c/drivers/media/video/gspca/pac7311.c --- b/drivers/media/video/gspca/pac7311.c 2009-10-30 17:09:52.000000000 +0100 +++ c/drivers/media/video/gspca/pac7311.c 2009-10-30 17:05:09.000000000 +0100 @@ -1078,8 +1078,22 @@ static int sd_getvflip(struct gspca_dev return 0; } -/* sub-driver description */ -static struct sd_desc sd_desc = { +/* sub-driver description for pac7302 */ +static struct sd_desc pac7302_sd_desc = { + .name = MODULE_NAME, + .ctrls = sd_ctrls, + .nctrls = ARRAY_SIZE(sd_ctrls), + .config = sd_config, + .init = sd_init, + .start = sd_start, + .stopN = sd_stopN, + .stop0 = sd_stop0, + .pkt_scan = sd_pkt_scan, + .dq_callback = do_autogain, +}; + +/* sub-driver description for pac7311 */ +static struct sd_desc pac7311_sd_desc = { .name = MODULE_NAME, .ctrls = sd_ctrls, .nctrls = ARRAY_SIZE(sd_ctrls), @@ -1117,8 +1131,12 @@ MODULE_DEVICE_TABLE(usb, device_table); static int sd_probe(struct usb_interface *intf, const struct usb_device_id *id) { - return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd), - THIS_MODULE); + if (id->driver_info == SENSOR_PAC7302) + return gspca_dev_probe(intf, id, &pac7302_sd_desc, + sizeof(struct sd), THIS_MODULE); + else + return gspca_dev_probe(intf, id, &pac7311_sd_desc, + sizeof(struct sd), THIS_MODULE); } static struct usb_driver sd_driver = {