Update of /cvsroot/alsa/alsa-driver/acore
In directory sc8-pr-cvs1:/tmp/cvs-serv14081/acore
Added Files:
info.inc info.patch
Removed Files:
info.c
Log Message:
More cleanups for alsa-kernel/ tree (.patch->.c rule)
--- NEW FILE: info.inc ---
#define __NO_VERSION__
#include <linux/config.h>
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/version.h>
#include <linux/proc_fs.h>
static int snd_info_card_readlink(struct dentry *dentry,
char *buffer, int buflen)
{
char *s = PDE(dentry->d_inode)->data;
int len;
if (s == NULL)
return -EIO;
len = strlen(s);
if (len > buflen)
len = buflen;
if (copy_to_user(buffer, s, len))
return -EFAULT;
return len;
}
static struct dentry *snd_info_card_followlink(struct dentry *dentry,
struct dentry *base,
unsigned int follow)
{
char *s = PDE(dentry->d_inode)->data;
return lookup_dentry(s, base, follow);
}
static struct file_operations snd_info_card_link_operations =
{
NULL
};
struct inode_operations snd_info_card_link_inode_operations =
{
.default_file_ops = &snd_info_card_link_operations,
.readlink = snd_info_card_readlink,
.follow_link = snd_info_card_followlink,
};
static struct proc_dir_entry *proc_symlink(const char *name,
struct proc_dir_entry *parent,
const char *dest)
{
char *s = snd_kmalloc_strdup(dest, GFP_KERNEL);
struct proc_dir_entry *p;
if (s == NULL)
return NULL;
p = create_proc_entry(name, S_IFLNK | S_IRUGO | S_IWUGO | S_IXUGO, parent);
if (p == NULL) {
kfree(s);
return NULL;
}
p->data = s;
p->ops = &snd_info_card_link_inode_operations;
return p;
}
static void snd_info_fill_inode(struct inode *inode, int fill)
{
if (fill)
MOD_INC_USE_COUNT;
else
MOD_DEC_USE_COUNT;
}
static inline void snd_info_entry_prepare(struct proc_dir_entry *de)
{
de->fill_inode = snd_info_fill_inode;
}
void snd_remove_proc_entry(struct proc_dir_entry *parent,
struct proc_dir_entry *de)
{
if (parent && de) {
if (S_ISDIR(de->mode) && de->data) {
kfree(de->data);
de->data = 0;
}
proc_unregister(parent, de->low_ino);
}
}
static struct inode_operations snd_info_entry_inode_operations =
{
&snd_info_entry_operations, /* default sound info directory
file-ops */
};
#endif /* LINUX_VERSION_CODE < 2.4.0 */
--- NEW FILE: info.patch ---
--- info.c 2003-05-30 14:29:41.000000000 +0200
+++ info.c 2003-05-30 14:28:42.000000000 +0200
@@ -1,3 +1,4 @@
+#include "info.inc"
/*
* Information interface for ALSA driver
* Copyright (c) by Jaroslav Kysela <[EMAIL PROTECTED]>
@@ -121,6 +122,7 @@
snd_info_entry_t *snd_oss_root = NULL;
#endif
+#ifndef LINUX_2_2
static inline void snd_info_entry_prepare(struct proc_dir_entry *de)
{
de->owner = THIS_MODULE;
@@ -132,6 +134,7 @@
if (de)
remove_proc_entry(de->name, parent);
}
+#endif
static loff_t snd_info_entry_llseek(struct file *file, loff_t offset, int orig)
{
@@ -141,7 +144,9 @@
data = snd_magic_cast(snd_info_private_data_t, file->private_data, return
-ENXIO);
entry = data->entry;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 3)
lock_kernel();
+#endif
switch (entry->content) {
case SNDRV_INFO_CONTENT_TEXT:
switch (orig) {
@@ -170,7 +175,9 @@
}
ret = -ENXIO;
out:
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 3)
unlock_kernel();
+#endif
return ret;
}
@@ -489,7 +496,9 @@
static struct file_operations snd_info_entry_operations =
{
+#ifndef LINUX_2_2
.owner = THIS_MODULE,
+#endif
.llseek = snd_info_entry_llseek,
.read = snd_info_entry_read,
.write = snd_info_entry_write,
@@ -908,9 +917,16 @@
up(&info_mutex);
return -ENOMEM;
}
+#ifndef LINUX_2_2
p->owner = entry->module;
- if (!S_ISDIR(entry->mode))
+#endif
+ if (!S_ISDIR(entry->mode)) {
+#ifndef LINUX_2_2
p->proc_fops = &snd_info_entry_operations;
+#else
+ p->ops = &snd_info_entry_inode_operations;
+#endif
+ }
p->size = entry->size;
p->data = entry;
entry->p = p;
--- info.c DELETED ---
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog