From patchwork Thu Jan 7 08:32:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7974611 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2557C9F1CC for ; Thu, 7 Jan 2016 08:36:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E47120120 for ; Thu, 7 Jan 2016 08:36:06 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 427CB20122 for ; Thu, 7 Jan 2016 08:36:05 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 37E49265966; Thu, 7 Jan 2016 09:36:04 +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 BCB8D265888; Thu, 7 Jan 2016 09:33:53 +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 E7A1626584A; Thu, 7 Jan 2016 09:33:51 +0100 (CET) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by alsa0.perex.cz (Postfix) with ESMTP id 075D7265546 for ; Thu, 7 Jan 2016 09:33:16 +0100 (CET) Received: by mail-pa0-f50.google.com with SMTP id cy9so253264407pac.0 for ; Thu, 07 Jan 2016 00:33:15 -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=KMNgO/wOjTcmtA79EviLkZM9TFDjYIF8nO4NKesgKkE=; b=c82qzB9/UroXrOGofHK8NDW/TbkNt/57STbWV0GIdNpkZl12S95tNkye9ThgrIMVbm CvgLtCyI383UFhtFrmNXNC0R70qMa+iBFRrLxLtcvXwO18/f2Q/RwGsLu2jaKanaM8ZB LejcmpfnZr/Oo15nDwZ+mf7/66eWIG6z/9YMNah4p2En3X1nFiea/b1aWDl3KCOJIwee w3MVxIknRKf5294AeczfjDuWaWq8lP6E3c1CIYssluzVUpzCF1TVnqE8YpgKh1NZiAC2 jLccEVIL13q5SA/0IBU3zKFMGUZEumLpYsHZaueQIHo72nsAzx6ULfZNA6i+6quhskXY amxg== X-Received: by 10.67.14.201 with SMTP id fi9mr149069523pad.41.1452155595367; Thu, 07 Jan 2016 00:33:15 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([183.82.228.160]) by smtp.gmail.com with ESMTPSA id cq4sm35258802pad.28.2016.01.07.00.33.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Jan 2016 00:33:14 -0800 (PST) From: Sudip Mukherjee To: Jaroslav Kysela , Takashi Iwai Date: Thu, 7 Jan 2016 14:02:49 +0530 Message-Id: <1452155569-6763-5-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452155569-6763-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1452155569-6763-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 5/5] ALSA: mts64: 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 mts64 driver to use the new parallel port device model. Signed-off-by: Sudip Mukherjee --- sound/drivers/mts64.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c index ee6a87f..4d393ea 100644 --- a/sound/drivers/mts64.c +++ b/sound/drivers/mts64.c @@ -905,9 +905,10 @@ static void snd_mts64_detach(struct parport *p) } static struct parport_driver mts64_parport_driver = { - .name = "mts64", - .attach = snd_mts64_attach, - .detach = snd_mts64_detach + .name = "mts64", + .match_port = snd_mts64_attach, + .detach = snd_mts64_detach, + .devmodel = true, }; /********************************************************************* @@ -935,6 +936,7 @@ static int snd_mts64_probe(struct platform_device *pdev) struct snd_card *card = NULL; struct mts64 *mts = NULL; int err; + struct pardev_cb mts64_cb; p = platform_get_drvdata(pdev); platform_set_drvdata(pdev, NULL); @@ -959,14 +961,16 @@ static int snd_mts64_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_mts64_interrupt, /* ISR */ - PARPORT_DEV_EXCL, /* flags */ - (void *)card); /* private */ - if (pardev == NULL) { + memset(&mts64_cb, 0, sizeof(mts64_cb)); + mts64_cb.private = card; /* private */ + mts64_cb.irq_func = snd_mts64_interrupt; /* ISR */ + mts64_cb.flags = PARPORT_DEV_EXCL; /* flags */ + + pardev = parport_register_dev_model(p, /* port */ + DRIVER_NAME, /* name */ + &mts64_cb, /* callbacks */ + device_count); /* device number */ + if (!pardev) { snd_printd("Cannot register pardevice\n"); err = -EIO; goto __err;