Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
Cc: alsa-devel@lists.sourceforge.net,
	Bill Gatliff <bgat@billgatliff.com>, Nicolas Pitre <nico@cam.org>
Subject: Re: [PATCH] AC97 bus interface for ad-hoc drivers
Date: Wed, 27 Jul 2005 13:10:21 +0200	[thread overview]
Message-ID: <s5hbr4old2a.wl%tiwai@suse.de> (raw)
In-Reply-To: <1121775624.14604.14.camel@cearnarfon>

At Tue, 19 Jul 2005 13:20:24 +0100,
Liam Girdwood wrote:
> 
> This patch adds support for ad-hoc AC97 device drivers (e.g WM97xx and
> UCB touchscreen drivers) and was originally posted to the list by
> Nicolas Pitre as an RFC. 
> 
> Changes from RFC version :-
> 
>   o Now matches codec name within codec group.
>   o Added ac97_dev_release() to stop kernel complaining about no release
> method for device.

Thanks for the patch.  The idea is fine, and the code looks almost
OK except for the below.

Could you describe the full changelog (or paste Nicolas' RFC) ?


> diff --git a/sound/pci/ac97/Makefile b/sound/pci/ac97/Makefile
> --- a/sound/pci/ac97/Makefile
> +++ b/sound/pci/ac97/Makefile
> @@ -12,7 +12,7 @@ endif
>  snd-ak4531-codec-objs := ak4531_codec.o
>  
>  # Toplevel Module Dependency
> -obj-$(CONFIG_SND_AC97_CODEC) += snd-ac97-codec.o
> +obj-$(CONFIG_SND_AC97_CODEC) += snd-ac97-codec.o ac97_bus.o

Better to keep snd- prefix for ac97_bus module (although it can be
used independently from ALSA)...?  It's an open question.

> diff --git a/sound/pci/ac97/ac97_bus.c b/sound/pci/ac97/ac97_bus.c
> new file mode 100644
> --- /dev/null
> +++ b/sound/pci/ac97/ac97_bus.c
(snip)
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/device.h>
> +#include <linux/string.h>
> +
> +#include <sound/driver.h>
> +#include <sound/core.h>
> +#include <sound/ac97_codec.h>

Don't include unnecessary header files.

> diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
> --- a/sound/pci/ac97/ac97_codec.c
> +++ b/sound/pci/ac97/ac97_codec.c
(snip)
> @@ -2117,6 +2124,14 @@ int snd_ac97_mixer(ac97_bus_t *bus, ac97
>  		snd_ac97_free(ac97);
>  		return err;
>  	}
> +
> +	ac97->dev.bus = &ac97_bus_type;
> +	ac97->dev.parent = ac97->bus->card->dev;
> +	ac97->dev.platform_data = ac97;
> +	ac97->dev.release = ac97_dev_release;
> +	strncpy(ac97->dev.bus_id, snd_ac97_get_short_name(ac97), BUS_ID_SIZE);
> +	if ((err = device_register(&ac97->dev)) < 0)
> +		return err;

Need to call snd_ac97_free() in the error path (but reset dev.bus to
NULL to avoid unregister).


Takashi


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

  reply	other threads:[~2005-07-27 11:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-19 12:20 [PATCH] AC97 bus interface for ad-hoc drivers Liam Girdwood
2005-07-27 11:10 ` Takashi Iwai [this message]
2005-07-27 13:05   ` Nicolas Pitre
2005-07-27 13:18     ` Takashi Iwai
2005-07-27 13:43       ` Liam Girdwood
2005-07-28 20:26     ` Liam Girdwood
2005-07-29 10:45       ` Takashi Iwai
2005-07-29 11:20         ` Liam Girdwood
2005-07-29 11:27           ` Takashi Iwai
2005-07-29 12:51             ` Liam Girdwood
2005-07-29 15:19               ` Takashi Iwai
2005-07-31 14:26                 ` Liam Girdwood

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=s5hbr4old2a.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=bgat@billgatliff.com \
    --cc=liam.girdwood@wolfsonmicro.com \
    --cc=nico@cam.org \
    /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