Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178776
b: refs/heads/master
c: eb1c838
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Jan 6, 2010
1 parent a8fc456 commit 91a5ae0
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 59 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e04ed38d4e0cd32141f723560efcc8252b0241e2
refs/heads/master: eb1c838fca2248ae62e5472b496ab52d3d774cc5
2 changes: 1 addition & 1 deletion trunk/arch/x86/Kconfig.cpu
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ config X86_TSC

config X86_CMPXCHG64
def_bool y
depends on !M386 && !M486
depends on X86_PAE || X86_64 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MATOM

# this should be set for all -march=.. options where the compiler
# generates cmov.
Expand Down
21 changes: 15 additions & 6 deletions trunk/fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1772,7 +1772,8 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
loff_t *ppos,
size_t count,
int appending,
int *direct_io)
int *direct_io,
int *has_refcount)
{
int ret = 0, meta_level = 0;
struct inode *inode = dentry->d_inode;
Expand Down Expand Up @@ -1833,6 +1834,8 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
saved_pos,
count,
&meta_level);
if (has_refcount)
*has_refcount = 1;
}

if (ret < 0) {
Expand All @@ -1856,6 +1859,10 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
break;
}

if (has_refcount && *has_refcount == 1) {
*direct_io = 0;
break;
}
/*
* Allowing concurrent direct writes means
* i_size changes wouldn't be synchronized, so
Expand Down Expand Up @@ -1899,7 +1906,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
loff_t pos)
{
int ret, direct_io, appending, rw_level, have_alloc_sem = 0;
int can_do_direct;
int can_do_direct, has_refcount = 0;
ssize_t written = 0;
size_t ocount; /* original count */
size_t count; /* after file limit checks */
Expand Down Expand Up @@ -1942,7 +1949,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
can_do_direct = direct_io;
ret = ocfs2_prepare_inode_for_write(file->f_path.dentry, ppos,
iocb->ki_left, appending,
&can_do_direct);
&can_do_direct, &has_refcount);
if (ret < 0) {
mlog_errno(ret);
goto out;
Expand Down Expand Up @@ -2006,14 +2013,16 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
/* buffered aio wouldn't have proper lock coverage today */
BUG_ON(ret == -EIOCBQUEUED && !(file->f_flags & O_DIRECT));

if ((file->f_flags & O_DSYNC && !direct_io) || IS_SYNC(inode)) {
if ((file->f_flags & O_DSYNC && !direct_io) || IS_SYNC(inode) ||
(file->f_flags & O_DIRECT && has_refcount)) {
ret = filemap_fdatawrite_range(file->f_mapping, pos,
pos + count - 1);
if (ret < 0)
written = ret;

if (!ret && (old_size != i_size_read(inode) ||
old_clusters != OCFS2_I(inode)->ip_clusters)) {
old_clusters != OCFS2_I(inode)->ip_clusters ||
has_refcount)) {
ret = jbd2_journal_force_commit(osb->journal->j_journal);
if (ret < 0)
written = ret;
Expand Down Expand Up @@ -2062,7 +2071,7 @@ static int ocfs2_splice_to_file(struct pipe_inode_info *pipe,
int ret;

ret = ocfs2_prepare_inode_for_write(out->f_path.dentry, &sd->pos,
sd->total_len, 0, NULL);
sd->total_len, 0, NULL, NULL);
if (ret < 0) {
mlog_errno(ret);
return ret;
Expand Down
6 changes: 6 additions & 0 deletions trunk/sound/soc/codecs/ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ static int ac97_soc_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&codec->dapm_widgets);
INIT_LIST_HEAD(&codec->dapm_paths);

ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
if (ret < 0) {
printk(KERN_ERR "ASoC: failed to init gen ac97 glue\n");
goto err;
}

/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
if (ret < 0)
Expand Down
14 changes: 7 additions & 7 deletions trunk/sound/soc/codecs/wm8510.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,23 +424,23 @@ static int wm8510_pcm_hw_params(struct snd_pcm_substream *substream,

/* filter coefficient */
switch (params_rate(params)) {
case SNDRV_PCM_RATE_8000:
case 8000:
adn |= 0x5 << 1;
break;
case SNDRV_PCM_RATE_11025:
case 11025:
adn |= 0x4 << 1;
break;
case SNDRV_PCM_RATE_16000:
case 16000:
adn |= 0x3 << 1;
break;
case SNDRV_PCM_RATE_22050:
case 22050:
adn |= 0x2 << 1;
break;
case SNDRV_PCM_RATE_32000:
case 32000:
adn |= 0x1 << 1;
break;
case SNDRV_PCM_RATE_44100:
case SNDRV_PCM_RATE_48000:
case 44100:
case 48000:
break;
}

Expand Down
14 changes: 7 additions & 7 deletions trunk/sound/soc/codecs/wm8940.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,23 +378,23 @@ static int wm8940_i2s_hw_params(struct snd_pcm_substream *substream,
iface |= (1 << 9);

switch (params_rate(params)) {
case SNDRV_PCM_RATE_8000:
case 8000:
addcntrl |= (0x5 << 1);
break;
case SNDRV_PCM_RATE_11025:
case 11025:
addcntrl |= (0x4 << 1);
break;
case SNDRV_PCM_RATE_16000:
case 16000:
addcntrl |= (0x3 << 1);
break;
case SNDRV_PCM_RATE_22050:
case 22050:
addcntrl |= (0x2 << 1);
break;
case SNDRV_PCM_RATE_32000:
case 32000:
addcntrl |= (0x1 << 1);
break;
case SNDRV_PCM_RATE_44100:
case SNDRV_PCM_RATE_48000:
case 44100:
case 48000:
break;
}
ret = snd_soc_write(codec, WM8940_ADDCNTRL, addcntrl);
Expand Down
14 changes: 7 additions & 7 deletions trunk/sound/soc/codecs/wm8974.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,23 +482,23 @@ static int wm8974_pcm_hw_params(struct snd_pcm_substream *substream,

/* filter coefficient */
switch (params_rate(params)) {
case SNDRV_PCM_RATE_8000:
case 8000:
adn |= 0x5 << 1;
break;
case SNDRV_PCM_RATE_11025:
case 11025:
adn |= 0x4 << 1;
break;
case SNDRV_PCM_RATE_16000:
case 16000:
adn |= 0x3 << 1;
break;
case SNDRV_PCM_RATE_22050:
case 22050:
adn |= 0x2 << 1;
break;
case SNDRV_PCM_RATE_32000:
case 32000:
adn |= 0x1 << 1;
break;
case SNDRV_PCM_RATE_44100:
case SNDRV_PCM_RATE_48000:
case 44100:
case 48000:
break;
}

Expand Down
30 changes: 0 additions & 30 deletions trunk/sound/soc/sh/fsi-ak4642.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,42 +42,12 @@ static struct snd_soc_device fsi_snd_devdata = {
.codec_dev = &soc_codec_dev_ak4642,
};

#define AK4642_BUS 0
#define AK4642_ADR 0x12
static int ak4642_add_i2c_device(void)
{
struct i2c_board_info info;
struct i2c_adapter *adapter;
struct i2c_client *client;

memset(&info, 0, sizeof(struct i2c_board_info));
info.addr = AK4642_ADR;
strlcpy(info.type, "ak4642", I2C_NAME_SIZE);

adapter = i2c_get_adapter(AK4642_BUS);
if (!adapter) {
printk(KERN_DEBUG "can't get i2c adapter\n");
return -ENODEV;
}

client = i2c_new_device(adapter, &info);
i2c_put_adapter(adapter);
if (!client) {
printk(KERN_DEBUG "can't add i2c device\n");
return -ENODEV;
}

return 0;
}

static struct platform_device *fsi_snd_device;

static int __init fsi_ak4642_init(void)
{
int ret = -ENOMEM;

ak4642_add_i2c_device();

fsi_snd_device = platform_device_alloc("soc-audio", -1);
if (!fsi_snd_device)
goto out;
Expand Down

0 comments on commit 91a5ae0

Please sign in to comment.