Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190541
b: refs/heads/master
c: e4a7b9b
h: refs/heads/master
i:
  190539: 818f51c
v: v3
  • Loading branch information
Wolfram Sang authored and Jean Delvare committed May 4, 2010
1 parent 6734342 commit 5c80906
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 22 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: f5fa05d97252b23b12749a7cd02710870c0762b0
refs/heads/master: e4a7b9b04de15f6b63da5ccdd373ffa3057a3681
5 changes: 5 additions & 0 deletions trunk/Documentation/i2c/writing-clients
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ structure at all. You should use this to keep device-specific data.
/* retrieve the value */
void *i2c_get_clientdata(const struct i2c_client *client);

Note that starting with kernel 2.6.34, you don't have to set the `data' field
to NULL in remove() or if probe() failed anymore. The i2c-core does this
automatically on these occasions. Those are also the only times the core will
touch this field.


Accessing the client
====================
Expand Down
8 changes: 6 additions & 2 deletions trunk/drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ static int i2c_device_probe(struct device *dev)
dev_dbg(dev, "probe\n");

status = driver->probe(client, i2c_match_id(driver->id_table, client));
if (status)
if (status) {
client->driver = NULL;
i2c_set_clientdata(client, NULL);
}
return status;
}

Expand All @@ -139,8 +141,10 @@ static int i2c_device_remove(struct device *dev)
dev->driver = NULL;
status = 0;
}
if (status == 0)
if (status == 0) {
client->driver = NULL;
i2c_set_clientdata(client, NULL);
}
return status;
}

Expand Down
5 changes: 1 addition & 4 deletions trunk/kernel/cgroup_freezer.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,9 @@ static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task)
* No lock is needed, since the task isn't on tasklist yet,
* so it can't be moved to another cgroup, which means the
* freezer won't be removed and will be valid during this
* function call. Nevertheless, apply RCU read-side critical
* section to suppress RCU lockdep false positives.
* function call.
*/
rcu_read_lock();
freezer = task_freezer(task);
rcu_read_unlock();

/*
* The root cgroup is non-freezable, so we can skip the
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -4897,7 +4897,7 @@ SYSCALL_DEFINE5(perf_event_open,

err_free_put_context:
if (err < 0)
free_event(event);
kfree(event);

err_put_context:
if (err < 0)
Expand Down
18 changes: 4 additions & 14 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,15 +323,6 @@ static inline struct task_group *task_group(struct task_struct *p)
/* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
static inline void set_task_rq(struct task_struct *p, unsigned int cpu)
{
/*
* Strictly speaking this rcu_read_lock() is not needed since the
* task_group is tied to the cgroup, which in turn can never go away
* as long as there are tasks attached to it.
*
* However since task_group() uses task_subsys_state() which is an
* rcu_dereference() user, this quiets CONFIG_PROVE_RCU.
*/
rcu_read_lock();
#ifdef CONFIG_FAIR_GROUP_SCHED
p->se.cfs_rq = task_group(p)->cfs_rq[cpu];
p->se.parent = task_group(p)->se[cpu];
Expand All @@ -341,7 +332,6 @@ static inline void set_task_rq(struct task_struct *p, unsigned int cpu)
p->rt.rt_rq = task_group(p)->rt_rq[cpu];
p->rt.parent = task_group(p)->rt_se[cpu];
#endif
rcu_read_unlock();
}

#else
Expand Down Expand Up @@ -3790,7 +3780,7 @@ int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner)
* the mutex owner just released it and exited.
*/
if (probe_kernel_address(&owner->cpu, cpu))
return 0;
goto out;
#else
cpu = owner->cpu;
#endif
Expand All @@ -3800,14 +3790,14 @@ int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner)
* the cpu field may no longer be valid.
*/
if (cpu >= nr_cpumask_bits)
return 0;
goto out;

/*
* We need to validate that we can do a
* get_cpu() and that we have the percpu area.
*/
if (!cpu_online(cpu))
return 0;
goto out;

rq = cpu_rq(cpu);

Expand All @@ -3826,7 +3816,7 @@ int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner)

cpu_relax();
}

out:
return 1;
}
#endif
Expand Down

0 comments on commit 5c80906

Please sign in to comment.