From: Takashi Iwai <tiwai@suse.de>
To: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Greg KH <greg@kroah.com>,
alsa-devel@alsa-project.org, Amit Shah <amitshah@gmx.net>,
linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] sysfs: WARNING: at fs/sysfs/dir.c:424 sysfs_add_one() - with ALSA
Date: Tue, 30 Oct 2007 14:12:11 +0100 [thread overview]
Message-ID: <s5hr6jcpx04.wl%tiwai@suse.de> (raw)
In-Reply-To: <s5hve8qnzrp.wl%tiwai@suse.de>
At Mon, 29 Oct 2007 08:30:50 +0100,
I wrote:
>
> At Fri, 26 Oct 2007 22:45:38 +0530,
> Kamalesh Babulal wrote:
> >
> > Takashi Iwai wrote:
> > > At Fri, 26 Oct 2007 08:52:02 -0700,
> > > Greg KH wrote:
> > >> On Fri, Oct 26, 2007 at 02:47:22PM +0530, Kamalesh Babulal wrote:
> > >>> I get similar warning, while loading the alsa driver
> > >> This is a different problem, not a rename issue like the network one
> > >> was.
> > >>
> > >>> [ 191.933548] Advanced Linux Sound Architecture Driver Version 1.0.15
> > >>> (Tue Oct 23 06:09:18 2007 UTC).
> > >>> [ 191.996323] ALSA sound/core/seq/oss/seq_oss.c:232: can't register
> > >>> device seq
> > >>> [ 192.046004] sysfs: duplicate filename 'audio' can not be created
> > >>> [ 192.086048] WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()
> > >> This is an error in the alsa core, perhaps the alsa developers can help
> > >> figure out why they are registering the same file twice?
> > >
> > > ALSA core shouldn't do so. Maybe a built-in OSS driver conflict with
> > > ALSA? We'd need to check .config, then.
> > >
> > >
> > > Takashi
> > > -
> > Hi Takashi,
> >
> > Attaching the .config file,
>
> You're using allyesconfig, and it's a missing runtime configuration to
> avoid the duplication. Some ALSA and OSS drivers can be loaded
> without real hardwares. With allyesconfig, ALSA and OSS drivers may
> be registered to the same device unless explicitly set up.
Meanwhile, it's not sexy to have such warnings from sysfs core, not
from the caller side.
The (untested) patch below may fix the problem. Now the standard
register_sound_*() is used for old OSS code. Please give it a try.
Takashi
[PATCH] Use register_sound_*() in OSS core code
Use the standard register_sound_*() functions instead of calling
device_create() directly in the old OSS core code.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
diff --git a/sound/oss/soundcard.c b/sound/oss/soundcard.c
index a9c23b2..2c20e70 100644
--- a/sound/oss/soundcard.c
+++ b/sound/oss/soundcard.c
@@ -523,15 +523,11 @@ bad:
*/
static const struct {
unsigned short minor;
- char *name;
- umode_t mode;
int *num;
} dev_list[] = { /* list of minor devices */
/* seems to be some confusion here -- this device is not in the device list */
- {SND_DEV_DSP16, "dspW", S_IWUGO | S_IRUSR | S_IRGRP,
- &num_audiodevs},
- {SND_DEV_AUDIO, "audio", S_IWUGO | S_IRUSR | S_IRGRP,
- &num_audiodevs},
+ {SND_DEV_DSP16, &num_audiodevs},
+ {SND_DEV_AUDIO, &num_audiodevs},
};
static int dmabuf;
@@ -560,17 +556,11 @@ static int __init oss_init(void)
sound_dmap_flag = (dmabuf > 0 ? 1 : 0);
for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
- device_create(sound_class, NULL,
- MKDEV(SOUND_MAJOR, dev_list[i].minor),
- "%s", dev_list[i].name);
-
if (!dev_list[i].num)
continue;
-
- for (j = 1; j < *dev_list[i].num; j++)
- device_create(sound_class, NULL,
- MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)),
- "%s%d", dev_list[i].name, j);
+ for (j = 0; j < *dev_list[i].num; j++)
+ register_sound_special(&oss_sound_fops,
+ dev_list[i].minor + (j * 0x10));
}
if (sound_nblocks >= 1024)
@@ -584,11 +574,10 @@ static void __exit oss_cleanup(void)
int i, j;
for (i = 0; i < ARRAY_SIZE(dev_list); i++) {
- device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor));
if (!dev_list[i].num)
continue;
- for (j = 1; j < *dev_list[i].num; j++)
- device_destroy(sound_class, MKDEV(SOUND_MAJOR, dev_list[i].minor + (j*0x10)));
+ for (j = 0; j < *dev_list[i].num; j++)
+ unregister_sound_special(dev_list[i].minor + (j * 0x10));
}
unregister_sound_special(1);
diff --git a/sound/sound_core.c b/sound/sound_core.c
index 46daca1..3a22848 100644
--- a/sound/sound_core.c
+++ b/sound/sound_core.c
@@ -259,6 +259,9 @@ int register_sound_special_device(const struct file_operations *fops, int unit,
case 4:
name = "audio";
break;
+ case 5:
+ name = "dspW";
+ break;
case 8:
name = "sequencer2";
if (unit >= SOUND_STEP)
next prev parent reply other threads:[~2007-10-30 15:23 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-26 7:14 sysfs: WARNING: at fs/sysfs/dir.c:424 sysfs_add_one() Amit Shah
2007-10-26 9:17 ` sysfs: WARNING: at fs/sysfs/dir.c:424 sysfs_add_one() - with ALSA Kamalesh Babulal
2007-10-26 15:52 ` Greg KH
2007-10-26 14:18 ` [alsa-devel] " Takashi Iwai
2007-10-26 16:17 ` Kay Sievers
2007-10-26 17:17 ` Kamalesh Babulal
2007-10-26 17:15 ` Kamalesh Babulal
[not found] ` <1193498376.32561.219.camel@razman.gruemaster.com>
2007-10-29 5:45 ` Kamalesh Babulal
2007-10-29 7:30 ` Takashi Iwai
2007-10-30 13:12 ` Takashi Iwai [this message]
2007-10-26 15:50 ` sysfs: WARNING: at fs/sysfs/dir.c:424 sysfs_add_one() Greg KH
2007-10-26 17:25 ` Amit Shah
2007-10-26 19:15 ` Greg KH
2007-10-26 20:25 ` Amit Shah
2007-10-26 20:30 ` Kay Sievers
2007-10-28 7:17 ` Amit Shah
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=s5hr6jcpx04.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=amitshah@gmx.net \
--cc=greg@kroah.com \
--cc=kamalesh@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®