From patchwork Thu Jan 7 07:15:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7973901 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0552BBEEE5 for ; Thu, 7 Jan 2016 07:19:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C4802015E for ; Thu, 7 Jan 2016 07:19:09 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id EC92920149 for ; Thu, 7 Jan 2016 07:19:07 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1828D2657B6; Thu, 7 Jan 2016 08:19:07 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 412462657F6; Thu, 7 Jan 2016 08:16:49 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1B9012657F6; Thu, 7 Jan 2016 08:16:48 +0100 (CET) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by alsa0.perex.cz (Postfix) with ESMTP id 876C7265546 for ; Thu, 7 Jan 2016 08:16:14 +0100 (CET) Received: by mail-pa0-f41.google.com with SMTP id uo6so233297880pac.1 for ; Wed, 06 Jan 2016 23:16:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xIJH7iQMO95LpLgZ7KvyrS1UraRYD9QZRTfbLYJknUU=; b=xbwH3zB1QuL3YFRlMOeD8wGkZTQwAytLSIyyaTDCMCdzyILzZ9veD6Od7IK0Fpbx8Z enABdthzrBTWVN1cuq7/XDXjzExn0v/yWk/4UESdBGMIr4tWCcGPW+XDzz8rM2mioLif SbPudKXOboZ/b9zyEmEUW/sNNoLXOA3DnBHHFyZ63wmM9+Qob5tvqJ2ygZFuf0qYwwI+ x3UInWzN3UbhK3hbE3Hm1+p4SVwPrGZmgpzymTjw+4dVEakGTIPA58mE4xs3uME+LJoC rYCIZf9FeKykx80omtErjzzh2ZqW8/uNM7ixr+mCR/zo8Y5vBY83W/8Ro/+k0bzX8p3Y Aoig== X-Received: by 10.66.102.9 with SMTP id fk9mr141150995pab.77.1452150973813; Wed, 06 Jan 2016 23:16:13 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([183.82.228.160]) by smtp.gmail.com with ESMTPSA id ah10sm149645792pad.23.2016.01.06.23.16.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jan 2016 23:16:13 -0800 (PST) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Thu, 7 Jan 2016 12:45:51 +0530 Message-Id: <1452150951-1571-6-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452150951-1571-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1452150951-1571-1-git-send-email-sudipm.mukherjee@gmail.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [alsa-devel] [PATCH 6/6] [ALSA] portman2x4 - use new parport device model X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Modify portman driver to use the new parallel port device model. Signed-off-by: Sudip Mukherjee --- sound/drivers/portman2x4.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c index 5fcde7d..88b25ca 100644 --- a/sound/drivers/portman2x4.c +++ b/sound/drivers/portman2x4.c @@ -704,9 +704,10 @@ static void snd_portman_detach(struct parport *p) } static struct parport_driver portman_parport_driver = { - .name = "portman2x4", - .attach = snd_portman_attach, - .detach = snd_portman_detach + .name = "portman2x4", + .match_port = snd_portman_attach, + .detach = snd_portman_detach, + .devmodel = true, }; /********************************************************************* @@ -734,6 +735,7 @@ static int snd_portman_probe(struct platform_device *pdev) struct snd_card *card = NULL; struct portman *pm = NULL; int err; + struct pardev_cb portman_cb; p = platform_get_drvdata(pdev); platform_set_drvdata(pdev, NULL); @@ -758,13 +760,15 @@ static int snd_portman_probe(struct platform_device *pdev) sprintf(card->longname, "%s at 0x%lx, irq %i", card->shortname, p->base, p->irq); - pardev = parport_register_device(p, /* port */ - DRIVER_NAME, /* name */ - NULL, /* preempt */ - NULL, /* wakeup */ - snd_portman_interrupt, /* ISR */ - PARPORT_DEV_EXCL, /* flags */ - (void *)card); /* private */ + memset(&portman_cb, 0, sizeof(portman_cb)); + portman_cb.private = card; /* private */ + portman_cb.irq_func = snd_portman_interrupt; /* ISR */ + portman_cb.flags = PARPORT_DEV_EXCL; /* flags */ + + pardev = parport_register_dev_model(p, /* port */ + DRIVER_NAME, /* name */ + &portman_cb, /* callbacks */ + device_count); /* device number */ if (!pardev) { snd_printd("Cannot register pardevice\n"); err = -EIO;