Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1303369
| From | Sudip Mukherjee <sudipm.mukherjee@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 5/5] ALSA: mts64: use new parport device model |
| Date | 2016-01-07 09:40 +0100 |
| Message-ID | <qOegW-5zh-13@gated-at.bofh.it> (permalink) |
| References | <qOegW-5zh-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Modify mts64 driver to use the new parallel port device model.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
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;
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 5/5] ALSA: mts64: use new parport device model Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2016-01-07 09:40 +0100
csiph-web