Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188063
b: refs/heads/master
c: 2aa2b50
h: refs/heads/master
i:
  188061: d53b4e7
  188059: a1267c7
  188055: e30fb0f
  188047: 18906ae
  188031: ac25f13
v: v3
  • Loading branch information
Ingo Molnar committed Mar 14, 2010
1 parent b707ea9 commit 8b927b2
Show file tree
Hide file tree
Showing 69 changed files with 391 additions and 764 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: 02ca6c407e0d43e6de5d646d26d87fc2eaa7a98b
refs/heads/master: 2aa2b50dd62b5d0675bd7453fbeb5732dc2d7866
4 changes: 2 additions & 2 deletions trunk/arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@

#include "mce-internal.h"

static DEFINE_MUTEX(mce_read_mutex);

#define rcu_dereference_check_mce(p) \
rcu_dereference_check((p), \
rcu_read_lock_sched_held() || \
Expand Down Expand Up @@ -1490,8 +1492,6 @@ static void collect_tscs(void *data)
rdtscll(cpu_tsc[smp_processor_id()]);
}

static DEFINE_MUTEX(mce_read_mutex);

static ssize_t mce_read(struct file *filp, char __user *ubuf, size_t usize,
loff_t *off)
{
Expand Down
24 changes: 12 additions & 12 deletions trunk/drivers/hid/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,22 @@ static const struct {
#define map_key_clear(c) hid_map_usage_clear(hidinput, usage, &bit, \
&max, EV_KEY, (c))

static inline int match_scancode(unsigned int code, unsigned int scancode)
static inline int match_scancode(int code, int scancode)
{
if (scancode == 0)
return 1;

return (code & (HID_USAGE_PAGE | HID_USAGE)) == scancode;
return ((code & (HID_USAGE_PAGE | HID_USAGE)) == scancode);
}

static inline int match_keycode(unsigned int code, unsigned int keycode)
static inline int match_keycode(int code, int keycode)
{
if (keycode == 0)
return 1;

return code == keycode;
return (code == keycode);
}

static struct hid_usage *hidinput_find_key(struct hid_device *hid,
unsigned int scancode,
unsigned int keycode)
int scancode, int keycode)
{
int i, j, k;
struct hid_report *report;
Expand All @@ -108,8 +105,8 @@ static struct hid_usage *hidinput_find_key(struct hid_device *hid,
return NULL;
}

static int hidinput_getkeycode(struct input_dev *dev,
unsigned int scancode, unsigned int *keycode)
static int hidinput_getkeycode(struct input_dev *dev, int scancode,
int *keycode)
{
struct hid_device *hid = input_get_drvdata(dev);
struct hid_usage *usage;
Expand All @@ -122,13 +119,16 @@ static int hidinput_getkeycode(struct input_dev *dev,
return -EINVAL;
}

static int hidinput_setkeycode(struct input_dev *dev,
unsigned int scancode, unsigned int keycode)
static int hidinput_setkeycode(struct input_dev *dev, int scancode,
int keycode)
{
struct hid_device *hid = input_get_drvdata(dev);
struct hid_usage *usage;
int old_keycode;

if (keycode < 0 || keycode > KEY_MAX)
return -EINVAL;

usage = hidinput_find_key(hid, scancode, 0);
if (usage) {
old_keycode = usage->code;
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/i2c/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ config I2C_SMBUS

source drivers/i2c/algos/Kconfig
source drivers/i2c/busses/Kconfig
source drivers/i2c/chips/Kconfig

config I2C_DEBUG_CORE
bool "I2C Core debugging messages"
Expand All @@ -97,4 +98,12 @@ config I2C_DEBUG_BUS
a problem with I2C support and want to see more of what is going
on.

config I2C_DEBUG_CHIP
bool "I2C Chip debugging messages"
help
Say Y here if you want the I2C chip drivers to produce a bunch of
debug messages to the system log. Select this if you are having
a problem with I2C support and want to see more of what is going
on.

endif # I2C
2 changes: 1 addition & 1 deletion trunk/drivers/i2c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ obj-$(CONFIG_I2C_BOARDINFO) += i2c-boardinfo.o
obj-$(CONFIG_I2C) += i2c-core.o
obj-$(CONFIG_I2C_SMBUS) += i2c-smbus.o
obj-$(CONFIG_I2C_CHARDEV) += i2c-dev.o
obj-y += algos/ busses/
obj-y += busses/ chips/ algos/

ifeq ($(CONFIG_I2C_DEBUG_CORE),y)
EXTRA_CFLAGS += -DDEBUG
Expand Down
9 changes: 0 additions & 9 deletions trunk/drivers/i2c/algos/i2c-algo-bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,12 +522,6 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
int i, ret;
unsigned short nak_ok;

if (adap->pre_xfer) {
ret = adap->pre_xfer(i2c_adap);
if (ret < 0)
return ret;
}

bit_dbg(3, &i2c_adap->dev, "emitting start condition\n");
i2c_start(adap);
for (i = 0; i < num; i++) {
Expand Down Expand Up @@ -576,9 +570,6 @@ static int bit_xfer(struct i2c_adapter *i2c_adap,
bailout:
bit_dbg(3, &i2c_adap->dev, "emitting stop condition\n");
i2c_stop(adap);

if (adap->post_xfer)
adap->post_xfer(i2c_adap);
return ret;
}

Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/i2c/busses/i2c-i801.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,9 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write,
data->block[0] = 32; /* max for SMBus block reads */
}

/* Experience has shown that the block buffer can only be used for
SMBus (not I2C) block transactions, even though the datasheet
doesn't mention this limitation. */
if ((i801_features & FEATURE_BLOCK_BUFFER)
&& command != I2C_SMBUS_I2C_BLOCK_DATA
&& !(command == I2C_SMBUS_I2C_BLOCK_DATA
&& read_write == I2C_SMBUS_READ)
&& i801_set_block_buffer_mode() == 0)
result = i801_block_transaction_by_block(data, read_write,
hwpec);
Expand Down
25 changes: 7 additions & 18 deletions trunk/drivers/i2c/busses/i2c-powermac.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,9 @@ static s32 i2c_powermac_smbus_xfer( struct i2c_adapter* adap,

rc = pmac_i2c_xfer(bus, addrdir, subsize, subaddr, buf, len);
if (rc) {
if (rc == -ENXIO)
dev_dbg(&adap->dev,
"I2C transfer at 0x%02x failed, size %d, "
"err %d\n", addrdir >> 1, size, rc);
else
dev_err(&adap->dev,
"I2C transfer at 0x%02x failed, size %d, "
"err %d\n", addrdir >> 1, size, rc);
dev_err(&adap->dev,
"I2C transfer at 0x%02x failed, size %d, err %d\n",
addrdir >> 1, size, rc);
goto bail;
}

Expand Down Expand Up @@ -180,16 +175,10 @@ static int i2c_powermac_master_xfer( struct i2c_adapter *adap,
goto bail;
}
rc = pmac_i2c_xfer(bus, addrdir, 0, 0, msgs->buf, msgs->len);
if (rc < 0) {
if (rc == -ENXIO)
dev_dbg(&adap->dev, "I2C %s 0x%02x failed, err %d\n",
addrdir & 1 ? "read from" : "write to",
addrdir >> 1, rc);
else
dev_err(&adap->dev, "I2C %s 0x%02x failed, err %d\n",
addrdir & 1 ? "read from" : "write to",
addrdir >> 1, rc);
}
if (rc < 0)
dev_err(&adap->dev, "I2C %s 0x%02x failed, err %d\n",
addrdir & 1 ? "read from" : "write to", addrdir >> 1,
rc);
bail:
pmac_i2c_close(bus);
return rc < 0 ? rc : 1;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/i2c/busses/i2c-xiic.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
Expand Down
19 changes: 19 additions & 0 deletions trunk/drivers/i2c/chips/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Miscellaneous I2C chip drivers configuration
#
# *** DEPRECATED! Do not add new entries! See Makefile ***
#

menu "Miscellaneous I2C Chip support"

config SENSORS_TSL2550
tristate "Taos TSL2550 ambient light sensor"
depends on EXPERIMENTAL
help
If you say yes here you get support for the Taos TSL2550
ambient light sensor.

This driver can also be built as a module. If so, the module
will be called tsl2550.

endmenu
18 changes: 18 additions & 0 deletions trunk/drivers/i2c/chips/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Makefile for miscellaneous I2C chip drivers.
#
# Do not add new drivers to this directory! It is DEPRECATED.
#
# Device drivers are better grouped according to the functionality they
# implement rather than to the bus they are connected to. In particular:
# * Hardware monitoring chip drivers go to drivers/hwmon
# * RTC chip drivers go to drivers/rtc
# * I/O expander drivers go to drivers/gpio
#

obj-$(CONFIG_SENSORS_TSL2550) += tsl2550.o

ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
EXTRA_CFLAGS += -DDEBUG
endif

Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ struct tsl2550_data {
struct i2c_client *client;
struct mutex update_lock;

unsigned int power_state:1;
unsigned int operating_mode:1;
unsigned int power_state : 1;
unsigned int operating_mode : 1;
};

/*
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/i2c/i2c-smbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/semaphore.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/i2c.h>
Expand Down Expand Up @@ -54,15 +55,15 @@ static int smbus_do_alert(struct device *dev, void *addrp)
* Drivers should either disable alerts, or provide at least
* a minimal handler. Lock so client->driver won't change.
*/
device_lock(dev);
down(&dev->sem);
if (client->driver) {
if (client->driver->alert)
client->driver->alert(client, data->flag);
else
dev_warn(&client->dev, "no driver alert()!\n");
} else
dev_dbg(&client->dev, "alert with no driver\n");
device_unlock(dev);
up(&dev->sem);

/* Stop iterating after we find the device */
return -EBUSY;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd,
struct input_absinfo abs;
struct ff_effect effect;
int __user *ip = (int __user *)p;
unsigned int i, t, u, v;
int i, t, u, v;
int error;

switch (cmd) {
Expand Down
38 changes: 19 additions & 19 deletions trunk/drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,7 @@ static int input_fetch_keycode(struct input_dev *dev, int scancode)
}

static int input_default_getkeycode(struct input_dev *dev,
unsigned int scancode,
unsigned int *keycode)
int scancode, int *keycode)
{
if (!dev->keycodesize)
return -EINVAL;
Expand All @@ -597,8 +596,7 @@ static int input_default_getkeycode(struct input_dev *dev,
}

static int input_default_setkeycode(struct input_dev *dev,
unsigned int scancode,
unsigned int keycode)
int scancode, int keycode)
{
int old_keycode;
int i;
Expand Down Expand Up @@ -656,9 +654,11 @@ static int input_default_setkeycode(struct input_dev *dev,
* This function should be called by anyone interested in retrieving current
* keymap. Presently keyboard and evdev handlers use it.
*/
int input_get_keycode(struct input_dev *dev,
unsigned int scancode, unsigned int *keycode)
int input_get_keycode(struct input_dev *dev, int scancode, int *keycode)
{
if (scancode < 0)
return -EINVAL;

return dev->getkeycode(dev, scancode, keycode);
}
EXPORT_SYMBOL(input_get_keycode);
Expand All @@ -672,14 +672,16 @@ EXPORT_SYMBOL(input_get_keycode);
* This function should be called by anyone needing to update current
* keymap. Presently keyboard and evdev handlers use it.
*/
int input_set_keycode(struct input_dev *dev,
unsigned int scancode, unsigned int keycode)
int input_set_keycode(struct input_dev *dev, int scancode, int keycode)
{
unsigned long flags;
int old_keycode;
int retval;

if (keycode > KEY_MAX)
if (scancode < 0)
return -EINVAL;

if (keycode < 0 || keycode > KEY_MAX)
return -EINVAL;

spin_lock_irqsave(&dev->event_lock, flags);
Expand Down Expand Up @@ -1879,37 +1881,35 @@ static int input_open_file(struct inode *inode, struct file *file)
const struct file_operations *old_fops, *new_fops = NULL;
int err;

err = mutex_lock_interruptible(&input_mutex);
if (err)
return err;

lock_kernel();
/* No load-on-demand here? */
handler = input_table[iminor(inode) >> 5];
if (handler)
new_fops = fops_get(handler->fops);

mutex_unlock(&input_mutex);
if (!handler || !(new_fops = fops_get(handler->fops))) {
err = -ENODEV;
goto out;
}

/*
* That's _really_ odd. Usually NULL ->open means "nothing special",
* not "no device". Oh, well...
*/
if (!new_fops || !new_fops->open) {
if (!new_fops->open) {
fops_put(new_fops);
err = -ENODEV;
goto out;
}

old_fops = file->f_op;
file->f_op = new_fops;

err = new_fops->open(inode, file);

if (err) {
fops_put(file->f_op);
file->f_op = fops_get(old_fops);
}
fops_put(old_fops);
out:
unlock_kernel();
return err;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/input/joystick/gamecon.c
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ static int __init gc_setup_pad(struct gc *gc, int idx, int pad_type)
int i;
int err;

if (pad_type < 1 || pad_type >= GC_MAX) {
if (pad_type < 1 || pad_type > GC_MAX) {
pr_err("Pad type %d unknown\n", pad_type);
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/input/keyboard/bf54x-keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static irqreturn_t bfin_kpad_isr(int irq, void *dev_id)
input_sync(input);

if (bfin_kpad_get_keypressed(bf54x_kpad)) {
disable_irq_nosync(bf54x_kpad->irq);
disable_irq(bf54x_kpad->irq);
bf54x_kpad->lastkey = key;
mod_timer(&bf54x_kpad->timer,
jiffies + bf54x_kpad->keyup_test_jiffies);
Expand Down
Loading

0 comments on commit 8b927b2

Please sign in to comment.