From: Takashi Iwai <tiwai@suse.de>
To: "Sudip Mukherjee" <sudipm.mukherjee@gmail.com>
Cc: "Jaroslav Kysela" <perex@perex.cz>, <alsa-devel@alsa-project.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 3/3] portman2x4 - use new parport device model
Date: Thu, 04 Feb 2016 17:51:07 +0100 [thread overview]
Message-ID: <s5hr3gse7wk.wl-tiwai@suse.de> (raw)
In-Reply-To: <1454603903-15967-3-git-send-email-sudipm.mukherjee@gmail.com>
On Thu, 04 Feb 2016 17:38:23 +0100,
Sudip Mukherjee wrote:
>
> Modify portman driver to use the new parallel port device model.
> The advantage of using the device model is that the device gets binded
> to the hardware, we get the feature of hotplug, we can bind/unbind
> the driver at runtime.
> The only change is in the way the driver gets registered with the
> parallel port subsystem and so as a result there is no user visible
> change or any chance of regression.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>
> v3: changed commit message
> v2:
> 1. pardev_cb is initialized while declaring, thus removing the use of
> memset.
> 2. used pdev->id.
> 3. v1 did not have the parport probe callback, but
> we will need the probe callback for binding as the name of the driver
> and the name of the device is different.
> 4. in v1 I missed modifying snd_portman_probe_port().
>
> sound/drivers/portman2x4.c | 53 ++++++++++++++++++++++++++++++++++------------
> 1 file changed, 39 insertions(+), 14 deletions(-)
>
> diff --git a/sound/drivers/portman2x4.c b/sound/drivers/portman2x4.c
> index 172685d..a22f56c 100644
> --- a/sound/drivers/portman2x4.c
> +++ b/sound/drivers/portman2x4.c
> @@ -650,10 +650,21 @@ static int snd_portman_probe_port(struct parport *p)
> {
> struct pardevice *pardev;
> int res;
> -
> - pardev = parport_register_device(p, DRIVER_NAME,
> - NULL, NULL, NULL,
> - 0, NULL);
> + struct pardev_cb pdev_cb = {
> + .preempt = NULL,
> + .wakeup = NULL,
> + .private = NULL,
> + .irq_func = NULL,
> + .flags = 0,
> + };
> +
> + /*
> + * Specify the device number as SNDRV_CARDS + 1 so that the
> + * device id alloted to this temporary device will never clash
> + * with an actual device already registered.
> + */
> + pardev = parport_register_dev_model(p, DRIVER_NAME, &pdev_cb,
> + SNDRV_CARDS + 1);
Hmm, doesn't this result in a device name like "xxx.33" ?
Also, what if multiple portman devices are registered?
I suppose rather it should be passing dev variable from
snd_portman_probe()?
thanks,
Takashi
next prev parent reply other threads:[~2016-02-04 16:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-04 16:38 [PATCH v3 1/3] portman2x4 - whitespace fixes Sudip Mukherjee
2016-02-04 16:38 ` [PATCH v3 2/3] portman2x4 - assignment in if Sudip Mukherjee
2016-02-04 16:38 ` [PATCH v3 3/3] portman2x4 - use new parport device model Sudip Mukherjee
2016-02-04 16:51 ` Takashi Iwai [this message]
2016-02-05 6:17 ` Sudip Mukherjee
2016-02-05 11:55 ` Takashi Iwai
2016-02-05 16:50 ` Sudip Mukherjee
2016-02-05 17:01 ` Takashi Iwai
2016-02-05 17:04 ` Sudip Mukherjee
2016-02-05 17:06 ` Takashi Iwai
2016-02-05 17:21 ` Sudip Mukherjee
2016-02-05 19:11 ` Takashi Iwai
2016-02-07 14:49 ` Sudip Mukherjee
2016-02-09 11:32 ` Takashi Iwai
2016-02-09 12:05 ` Sudip Mukherjee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hr3gse7wk.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox