Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/github/linux-2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Takeshi Matsuya committed May 1, 2010
2 parents 93d6f03 + be1066b commit ce37988
Show file tree
Hide file tree
Showing 57 changed files with 267 additions and 143 deletions.
2 changes: 1 addition & 1 deletion Documentation/spi/spidev_test.c
Expand Up @@ -58,7 +58,7 @@ static void transfer(int fd)
};

ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
if (ret == 1)
if (ret < 1)
pabort("can't send spi message");

for (ret = 0; ret < ARRAY_SIZE(tx); ret++) {
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/plat-omap/include/plat/usb.h
Expand Up @@ -46,7 +46,7 @@ struct ehci_hcd_omap_platform_data {
struct omap_musb_board_data {
u8 interface_type;
u8 mode;
u8 power;
u16 power;
};

enum musb_interface {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
Expand Down
9 changes: 7 additions & 2 deletions drivers/char/isicom.c
Expand Up @@ -879,8 +879,8 @@ static int isicom_open(struct tty_struct *tty, struct file *filp)
if (tport == NULL)
return -ENODEV;
port = container_of(tport, struct isi_port, port);
card = &isi_card[BOARD(tty->index)];

tty->driver_data = port;
return tty_port_open(tport, tty, filp);
}

Expand Down Expand Up @@ -936,7 +936,12 @@ static void isicom_shutdown(struct tty_port *port)
static void isicom_close(struct tty_struct *tty, struct file *filp)
{
struct isi_port *ip = tty->driver_data;
struct tty_port *port = &ip->port;
struct tty_port *port;

if (ip == NULL)
return;

port = &ip->port;
if (isicom_paranoia_check(ip, tty->name, "isicom_close"))
return;
tty_port_close(port, tty, filp);
Expand Down
2 changes: 2 additions & 0 deletions drivers/char/istallion.c
Expand Up @@ -827,6 +827,8 @@ static int stli_open(struct tty_struct *tty, struct file *filp)
return -ENODEV;
if (portp->devnr < 1)
return -ENODEV;

tty->driver_data = portp;
return tty_port_open(&portp->port, tty, filp);
}

Expand Down
3 changes: 2 additions & 1 deletion drivers/char/mxser.c
Expand Up @@ -1011,6 +1011,7 @@ static int mxser_open(struct tty_struct *tty, struct file *filp)
if (!info->ioaddr)
return -ENODEV;

tty->driver_data = info;
return tty_port_open(&info->port, tty, filp);
}

Expand Down Expand Up @@ -1074,7 +1075,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
struct mxser_port *info = tty->driver_data;
struct tty_port *port = &info->port;

if (tty->index == MXSER_PORTS)
if (tty->index == MXSER_PORTS || info == NULL)
return;
if (tty_port_close_start(port, tty, filp) == 0)
return;
Expand Down
1 change: 1 addition & 0 deletions drivers/char/riscom8.c
Expand Up @@ -909,6 +909,7 @@ static int rc_open(struct tty_struct *tty, struct file *filp)
if (error)
return error;

tty->driver_data = port;
return tty_port_open(&port->port, tty, filp);
}

Expand Down
7 changes: 4 additions & 3 deletions drivers/char/stallion.c
Expand Up @@ -724,7 +724,6 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
{
struct stlport *portp;
struct stlbrd *brdp;
struct tty_port *port;
unsigned int minordev, brdnr, panelnr;
int portnr;

Expand Down Expand Up @@ -754,7 +753,8 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
portp = brdp->panels[panelnr]->ports[portnr];
if (portp == NULL)
return -ENODEV;
port = &portp->port;

tty->driver_data = portp;
return tty_port_open(&portp->port, tty, filp);

}
Expand Down Expand Up @@ -841,7 +841,8 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
pr_debug("stl_close(tty=%p,filp=%p)\n", tty, filp);

portp = tty->driver_data;
BUG_ON(portp == NULL);
if(portp == NULL)
return;
tty_port_close(&portp->port, tty, filp);
}

Expand Down
5 changes: 2 additions & 3 deletions drivers/edac/edac_mce_amd.c
Expand Up @@ -294,7 +294,6 @@ static void amd_decode_ls_mce(u64 mc3_status)
void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors)
{
u32 ec = ERROR_CODE(regs->nbsl);
u32 xec = EXT_ERROR_CODE(regs->nbsl);

if (!handle_errors)
return;
Expand Down Expand Up @@ -324,7 +323,7 @@ void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors)
pr_cont("\n");
}

pr_emerg("%s.\n", EXT_ERR_MSG(xec));
pr_emerg("%s.\n", EXT_ERR_MSG(regs->nbsl));

if (BUS_ERROR(ec) && nb_bus_decoder)
nb_bus_decoder(node_id, regs);
Expand Down Expand Up @@ -374,7 +373,7 @@ static int amd_decode_mce(struct notifier_block *nb, unsigned long val,
((m->status & MCI_STATUS_PCC) ? "yes" : "no"));

/* do the two bits[14:13] together */
ecc = m->status & (3ULL << 45);
ecc = (m->status >> 45) & 0x3;
if (ecc)
pr_cont(", %sECC Error", ((ecc == 2) ? "C" : "U"));

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpio/gpiolib.c
Expand Up @@ -416,7 +416,8 @@ static int gpio_setup_irq(struct gpio_desc *desc, struct device *dev,
return 0;

free_sd:
sysfs_put(pdesc->value_sd);
if (pdesc)
sysfs_put(pdesc->value_sd);
free_id:
idr_remove(&pdesc_idr, id);
desc->flags &= GPIO_FLAGS_MASK;
Expand Down
2 changes: 1 addition & 1 deletion drivers/of/of_mdio.c
Expand Up @@ -69,7 +69,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
}

phy = get_phy_device(mdio, be32_to_cpup(addr));
if (!phy) {
if (!phy || IS_ERR(phy)) {
dev_err(&mdio->dev, "error probing PHY at address %i\n",
*addr);
continue;
Expand Down
2 changes: 2 additions & 0 deletions drivers/serial/8250_pnp.c
Expand Up @@ -348,6 +348,8 @@ static const struct pnp_device_id pnp_dev_table[] = {
{ "FUJ02E6", 0 },
/* Fujitsu Wacom 2FGT Tablet PC device */
{ "FUJ02E7", 0 },
/* Fujitsu Wacom 1FGT Tablet PC device */
{ "FUJ02E9", 0 },
/*
* LG C1 EXPRESS DUAL (C1-PB11A3) touch screen (actually a FUJ02E6 in
* disguise)
Expand Down
33 changes: 0 additions & 33 deletions drivers/serial/mpc52xx_uart.c
Expand Up @@ -29,39 +29,6 @@
* kind, whether express or implied.
*/

/* Platform device Usage :
*
* Since PSCs can have multiple function, the correct driver for each one
* is selected by calling mpc52xx_match_psc_function(...). The function
* handled by this driver is "uart".
*
* The driver init all necessary registers to place the PSC in uart mode without
* DCD. However, the pin multiplexing aren't changed and should be set either
* by the bootloader or in the platform init code.
*
* The idx field must be equal to the PSC index (e.g. 0 for PSC1, 1 for PSC2,
* and so on). So the PSC1 is mapped to /dev/ttyPSC0, PSC2 to /dev/ttyPSC1 and
* so on. But be warned, it's an ABSOLUTE REQUIREMENT ! This is needed mainly
* fpr the console code : without this 1:1 mapping, at early boot time, when we
* are parsing the kernel args console=ttyPSC?, we wouldn't know which PSC it
* will be mapped to.
*/

/* OF Platform device Usage :
*
* This driver is only used for PSCs configured in uart mode. The device
* tree will have a node for each PSC with "mpc52xx-psc-uart" in the compatible
* list.
*
* By default, PSC devices are enumerated in the order they are found. However
* a particular PSC number can be forces by adding 'device_no = <port#>'
* to the device node.
*
* The driver init all necessary registers to place the PSC in uart mode without
* DCD. However, the pin multiplexing aren't changed and should be set either
* by the bootloader or in the platform init code.
*/

#undef DEBUG

#include <linux/device.h>
Expand Down
4 changes: 3 additions & 1 deletion drivers/serial/pmac_zilog.c
Expand Up @@ -752,8 +752,10 @@ static void pmz_break_ctl(struct uart_port *port, int break_state)
uap->curregs[R5] = new_reg;

/* NOTE: Not subject to 'transmitter active' rule. */
if (ZS_IS_ASLEEP(uap))
if (ZS_IS_ASLEEP(uap)) {
spin_unlock_irqrestore(&port->lock, flags);
return;
}
write_zsreg(uap, R5, uap->curregs[R5]);
}

Expand Down
5 changes: 3 additions & 2 deletions drivers/spi/omap2_mcspi.c
Expand Up @@ -204,6 +204,7 @@ static inline void mcspi_write_chconf0(const struct spi_device *spi, u32 val)

cs->chconf0 = val;
mcspi_write_cs_reg(spi, OMAP2_MCSPI_CHCONF0, val);
mcspi_read_cs_reg(spi, OMAP2_MCSPI_CHCONF0);
}

static void omap2_mcspi_set_dma_req(const struct spi_device *spi,
Expand Down Expand Up @@ -532,7 +533,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
goto out;
}
#ifdef VERBOSE
dev_dbg(&spi->dev, "write-%d %04x\n",
dev_dbg(&spi->dev, "write-%d %08x\n",
word_len, *tx);
#endif
__raw_writel(*tx++, tx_reg);
Expand All @@ -550,7 +551,7 @@ omap2_mcspi_txrx_pio(struct spi_device *spi, struct spi_transfer *xfer)
mcspi_write_chconf0(spi, l);
*rx++ = __raw_readl(rx_reg);
#ifdef VERBOSE
dev_dbg(&spi->dev, "read-%d %04x\n",
dev_dbg(&spi->dev, "read-%d %08x\n",
word_len, *(rx - 1));
#endif
}
Expand Down
8 changes: 5 additions & 3 deletions drivers/spi/spi.c
Expand Up @@ -41,7 +41,7 @@ static void spidev_release(struct device *dev)
spi->master->cleanup(spi);

spi_master_put(spi->master);
kfree(dev);
kfree(spi);
}

static ssize_t
Expand Down Expand Up @@ -257,6 +257,7 @@ int spi_add_device(struct spi_device *spi)
{
static DEFINE_MUTEX(spi_add_lock);
struct device *dev = spi->master->dev.parent;
struct device *d;
int status;

/* Chipselects are numbered 0..max; validate. */
Expand All @@ -278,10 +279,11 @@ int spi_add_device(struct spi_device *spi)
*/
mutex_lock(&spi_add_lock);

if (bus_find_device_by_name(&spi_bus_type, NULL, dev_name(&spi->dev))
!= NULL) {
d = bus_find_device_by_name(&spi_bus_type, NULL, dev_name(&spi->dev));
if (d != NULL) {
dev_err(dev, "chipselect %d already in use\n",
spi->chip_select);
put_device(d);
status = -EBUSY;
goto done;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/dt3155/dt3155_drv.c
Expand Up @@ -464,9 +464,9 @@ static void dt3155_init_isr(int minor)
/* 50/60 Hz should be set before this point but let's make sure it is */
/* right anyway */

ReadI2C(dt3155_lbase[ minor ], CONFIG, &i2c_csr2.reg);
ReadI2C(dt3155_lbase[ minor ], CSR2, &i2c_csr2.reg);
i2c_csr2.fld.HZ50 = FORMAT50HZ;
WriteI2C(dt3155_lbase[ minor ], CONFIG, i2c_config.reg);
WriteI2C(dt3155_lbase[ minor ], CSR2, i2c_csr2.reg);

/* enable busmaster chip, clear flags */

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/hv/Hv.c
Expand Up @@ -306,9 +306,9 @@ void HvCleanup(void)
DPRINT_ENTER(VMBUS);

if (gHvContext.SignalEventBuffer) {
kfree(gHvContext.SignalEventBuffer);
gHvContext.SignalEventBuffer = NULL;
gHvContext.SignalEventParam = NULL;
kfree(gHvContext.SignalEventBuffer);
}

if (gHvContext.HypercallPage) {
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/hv/RndisFilter.c
Expand Up @@ -751,6 +751,7 @@ static int RndisFilterOpenDevice(struct rndis_device *Device)

ret = RndisFilterSetPacketFilter(Device,
NDIS_PACKET_TYPE_BROADCAST |
NDIS_PACKET_TYPE_ALL_MULTICAST |
NDIS_PACKET_TYPE_DIRECTED);
if (ret == 0)
Device->State = RNDIS_DEV_DATAINITIALIZED;
Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/hv/netvsc_drv.c
Expand Up @@ -403,8 +403,7 @@ static int netvsc_probe(struct device *device)
if (!net_drv_obj->Base.OnDeviceAdd)
return -1;

net = alloc_netdev(sizeof(struct net_device_context), "seth%d",
ether_setup);
net = alloc_etherdev(sizeof(struct net_device_context));
if (!net)
return -1;

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/iio/accel/lis3l02dq_core.c
Expand Up @@ -618,7 +618,7 @@ static int lis3l02dq_thresh_handler_th(struct iio_dev *dev_info,
static void lis3l02dq_thresh_handler_bh_no_check(struct work_struct *work_s)
{
struct iio_work_cont *wc
= container_of(work_s, struct iio_work_cont, ws_nocheck);
= container_of(work_s, struct iio_work_cont, ws);
struct lis3l02dq_state *st = wc->st;
u8 t;

Expand Down
3 changes: 3 additions & 0 deletions drivers/staging/iio/accel/lis3l02dq_ring.c
Expand Up @@ -493,6 +493,9 @@ int lis3l02dq_probe_trigger(struct iio_dev *indio_dev)
struct lis3l02dq_state *state = indio_dev->dev_data;

state->trig = iio_allocate_trigger();
if (!state->trig)
return -ENOMEM;

state->trig->name = kmalloc(IIO_TRIGGER_NAME_LENGTH, GFP_KERNEL);
if (!state->trig->name) {
ret = -ENOMEM;
Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/iio/adc/max1363_core.c
Expand Up @@ -557,6 +557,7 @@ static int __devinit max1363_probe(struct i2c_client *client,
if (!IS_ERR(st->reg))
regulator_put(st->reg);
error_free_st:
i2c_set_clientdata(client, NULL);
kfree(st);

error_ret:
Expand All @@ -574,6 +575,7 @@ static int max1363_remove(struct i2c_client *client)
regulator_disable(st->reg);
regulator_put(st->reg);
}
i2c_set_clientdata(client, NULL);
kfree(st);

return 0;
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/iio/industrialio-core.c
Expand Up @@ -537,6 +537,7 @@ static void iio_device_unregister_sysfs(struct iio_dev *dev_info)
sysfs_remove_group(&dev_info->dev.kobj, dev_info->attrs);
}

/* Return a negative errno on failure */
int iio_get_new_idr_val(struct idr *this_idr)
{
int ret;
Expand Down Expand Up @@ -660,7 +661,7 @@ static int iio_device_register_eventset(struct iio_dev *dev_info)
for (i = 0; i < dev_info->num_interrupt_lines; i++) {
dev_info->event_interfaces[i].owner = dev_info->driver_module;
ret = iio_get_new_idr_val(&iio_event_idr);
if (ret)
if (ret < 0)
goto error_free_setup_ev_ints;
else
dev_info->event_interfaces[i].id = ret;
Expand Down
2 changes: 2 additions & 0 deletions drivers/staging/iio/light/tsl2563.c
Expand Up @@ -682,6 +682,7 @@ static int __devinit tsl2563_probe(struct i2c_client *client,
fail2:
iio_device_unregister(chip->indio_dev);
fail1:
i2c_set_clientdata(client, NULL);
kfree(chip);
return err;
}
Expand All @@ -692,6 +693,7 @@ static int tsl2563_remove(struct i2c_client *client)

iio_device_unregister(chip->indio_dev);

i2c_set_clientdata(client, NULL);
kfree(chip);
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/iio/ring_sw.c
Expand Up @@ -293,7 +293,7 @@ int iio_read_last_from_sw_ring(struct iio_sw_ring_buffer *ring,
return -EAGAIN;
memcpy(data, last_written_p_copy, ring->buf.bpd);

if (unlikely(ring->last_written_p >= last_written_p_copy))
if (unlikely(ring->last_written_p != last_written_p_copy))
goto again;

iio_unmark_sw_rb_in_use(&ring->buf);
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/rt2860/usb_main_dev.c
Expand Up @@ -63,6 +63,7 @@ struct usb_device_id rtusb_usb_id[] = {
{USB_DEVICE(0x07D1, 0x3C11)}, /* D-Link */
{USB_DEVICE(0x14B2, 0x3C07)}, /* AL */
{USB_DEVICE(0x050D, 0x8053)}, /* Belkin */
{USB_DEVICE(0x050D, 0x825B)}, /* Belkin */
{USB_DEVICE(0x14B2, 0x3C23)}, /* Airlink */
{USB_DEVICE(0x14B2, 0x3C27)}, /* Airlink */
{USB_DEVICE(0x07AA, 0x002F)}, /* Corega */
Expand Down

0 comments on commit ce37988

Please sign in to comment.