Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299182
b: refs/heads/master
c: 9e0daff
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Apr 13, 2012
1 parent d27ffbe commit 6b330e7
Show file tree
Hide file tree
Showing 15 changed files with 58 additions and 66 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: 6e1173399d09aa7ab5db613911e38700b2307ece
refs/heads/master: 9e0daff30fd7ecf698e5d20b0fa7f851e427cca5
2 changes: 1 addition & 1 deletion trunk/arch/sparc/kernel/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,4 +1264,4 @@ static int __init ds_init(void)
return vio_register_driver(&ds_driver);
}

subsys_initcall(ds_init);
fs_initcall(ds_init);
2 changes: 1 addition & 1 deletion trunk/drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ config GPIO_ML_IOH

config GPIO_SODAVILLE
bool "Intel Sodaville GPIO support"
depends on X86 && PCI && OF
depends on X86 && PCI && OF && BROKEN
select GPIO_GENERIC
select GENERIC_IRQ_CHIP
help
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/gpio/gpio-adp5588.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ static irqreturn_t adp5588_irq_handler(int irq, void *devid)
if (ret < 0)
memset(dev->irq_stat, 0, ARRAY_SIZE(dev->irq_stat));

for (bank = 0, bit = 0; bank <= ADP5588_BANK(ADP5588_MAXGPIO);
for (bank = 0; bank <= ADP5588_BANK(ADP5588_MAXGPIO);
bank++, bit = 0) {
pending = dev->irq_stat[bank] & dev->irq_mask[bank];

Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/gpio/gpio-samsung.c
Original file line number Diff line number Diff line change
Expand Up @@ -2382,8 +2382,8 @@ static struct samsung_gpio_chip exynos4_gpios_3[] = {
#endif
};

#ifdef CONFIG_ARCH_EXYNOS5
static struct samsung_gpio_chip exynos5_gpios_1[] = {
#ifdef CONFIG_ARCH_EXYNOS5
{
.chip = {
.base = EXYNOS5_GPA0(0),
Expand Down Expand Up @@ -2541,11 +2541,11 @@ static struct samsung_gpio_chip exynos5_gpios_1[] = {
.to_irq = samsung_gpiolib_to_irq,
},
},
};
#endif
};

#ifdef CONFIG_ARCH_EXYNOS5
static struct samsung_gpio_chip exynos5_gpios_2[] = {
#ifdef CONFIG_ARCH_EXYNOS5
{
.chip = {
.base = EXYNOS5_GPE0(0),
Expand Down Expand Up @@ -2602,11 +2602,11 @@ static struct samsung_gpio_chip exynos5_gpios_2[] = {

},
},
};
#endif
};

#ifdef CONFIG_ARCH_EXYNOS5
static struct samsung_gpio_chip exynos5_gpios_3[] = {
#ifdef CONFIG_ARCH_EXYNOS5
{
.chip = {
.base = EXYNOS5_GPV0(0),
Expand Down Expand Up @@ -2638,20 +2638,20 @@ static struct samsung_gpio_chip exynos5_gpios_3[] = {
.label = "GPV4",
},
},
};
#endif
};

#ifdef CONFIG_ARCH_EXYNOS5
static struct samsung_gpio_chip exynos5_gpios_4[] = {
#ifdef CONFIG_ARCH_EXYNOS5
{
.chip = {
.base = EXYNOS5_GPZ(0),
.ngpio = EXYNOS5_GPIO_Z_NR,
.label = "GPZ",
},
},
};
#endif
};


#if defined(CONFIG_ARCH_EXYNOS) && defined(CONFIG_OF)
Expand Down
23 changes: 13 additions & 10 deletions trunk/drivers/gpio/gpio-sodaville.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
struct sdv_gpio_chip_data {
int irq_base;
void __iomem *gpio_pub_base;
struct irq_domain *id;
struct irq_domain id;
struct irq_chip_generic *gc;
struct bgpio_chip bgpio;
};
Expand All @@ -51,9 +51,10 @@ static int sdv_gpio_pub_set_type(struct irq_data *d, unsigned int type)
struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
struct sdv_gpio_chip_data *sd = gc->private;
void __iomem *type_reg;
u32 irq_offs = d->irq - sd->irq_base;
u32 reg;

if (d->hwirq < 8)
if (irq_offs < 8)
type_reg = sd->gpio_pub_base + GPIT1R0;
else
type_reg = sd->gpio_pub_base + GPIT1R1;
Expand All @@ -62,11 +63,11 @@ static int sdv_gpio_pub_set_type(struct irq_data *d, unsigned int type)

switch (type) {
case IRQ_TYPE_LEVEL_HIGH:
reg &= ~BIT(4 * (d->hwirq % 8));
reg &= ~BIT(4 * (irq_offs % 8));
break;

case IRQ_TYPE_LEVEL_LOW:
reg |= BIT(4 * (d->hwirq % 8));
reg |= BIT(4 * (irq_offs % 8));
break;

default:
Expand All @@ -90,7 +91,7 @@ static irqreturn_t sdv_gpio_pub_irq_handler(int irq, void *data)
u32 irq_bit = __fls(irq_stat);

irq_stat &= ~BIT(irq_bit);
generic_handle_irq(irq_find_mapping(sd->id, irq_bit));
generic_handle_irq(sd->irq_base + irq_bit);
}

return IRQ_HANDLED;
Expand Down Expand Up @@ -126,7 +127,7 @@ static int sdv_xlate(struct irq_domain *h, struct device_node *node,
}

static struct irq_domain_ops irq_domain_sdv_ops = {
.xlate = sdv_xlate,
.dt_translate = sdv_xlate,
};

static __devinit int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd,
Expand All @@ -148,6 +149,10 @@ static __devinit int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd,
if (ret)
goto out_free_desc;

sd->id.irq_base = sd->irq_base;
sd->id.of_node = of_node_get(pdev->dev.of_node);
sd->id.ops = &irq_domain_sdv_ops;

/*
* This gpio irq controller latches level irqs. Testing shows that if
* we unmask & ACK the IRQ before the source of the interrupt is gone
Expand All @@ -174,10 +179,7 @@ static __devinit int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd,
IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST,
IRQ_LEVEL | IRQ_NOPROBE);

sd->id = irq_domain_add_legacy(pdev->dev.of_node, SDV_NUM_PUB_GPIOS,
sd->irq_base, 0, &irq_domain_sdv_ops, sd);
if (!sd->id)
goto out_free_irq;
irq_domain_add(&sd->id);
return 0;
out_free_irq:
free_irq(pdev->irq, sd);
Expand Down Expand Up @@ -258,6 +260,7 @@ static void sdv_gpio_remove(struct pci_dev *pdev)
{
struct sdv_gpio_chip_data *sd = pci_get_drvdata(pdev);

irq_domain_del(&sd->id);
free_irq(pdev->irq, sd);
irq_free_descs(sd->irq_base, SDV_NUM_PUB_GPIOS);

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/hwmon/acpi_power_meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ static ssize_t show_str(struct device *dev,
break;
default:
BUG();
val = "";
}

return sprintf(buf, "%s\n", val);
Expand Down
17 changes: 9 additions & 8 deletions trunk/drivers/hwmon/pmbus/pmbus_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,13 +710,13 @@ static u16 pmbus_data2reg(struct pmbus_data *data,
* If a negative value is stored in any of the referenced registers, this value
* reflects an error code which will be returned.
*/
static int pmbus_get_boolean(struct pmbus_data *data, int index)
static int pmbus_get_boolean(struct pmbus_data *data, int index, int *val)
{
u8 s1 = (index >> 24) & 0xff;
u8 s2 = (index >> 16) & 0xff;
u8 reg = (index >> 8) & 0xff;
u8 mask = index & 0xff;
int ret, status;
int status;
u8 regval;

status = data->status[reg];
Expand All @@ -725,7 +725,7 @@ static int pmbus_get_boolean(struct pmbus_data *data, int index)

regval = status & mask;
if (!s1 && !s2)
ret = !!regval;
*val = !!regval;
else {
long v1, v2;
struct pmbus_sensor *sensor1, *sensor2;
Expand All @@ -739,9 +739,9 @@ static int pmbus_get_boolean(struct pmbus_data *data, int index)

v1 = pmbus_reg2data(data, sensor1);
v2 = pmbus_reg2data(data, sensor2);
ret = !!(regval && v1 >= v2);
*val = !!(regval && v1 >= v2);
}
return ret;
return 0;
}

static ssize_t pmbus_show_boolean(struct device *dev,
Expand All @@ -750,10 +750,11 @@ static ssize_t pmbus_show_boolean(struct device *dev,
struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
struct pmbus_data *data = pmbus_update_device(dev);
int val;
int err;

val = pmbus_get_boolean(data, attr->index);
if (val < 0)
return val;
err = pmbus_get_boolean(data, attr->index, &val);
if (err)
return err;
return snprintf(buf, PAGE_SIZE, "%d\n", val);
}

Expand Down
14 changes: 6 additions & 8 deletions trunk/drivers/hwmon/smsc47b397.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,10 @@ static int __init smsc47b397_device_add(unsigned short address)
return err;
}

static int __init smsc47b397_find(void)
static int __init smsc47b397_find(unsigned short *addr)
{
u8 id, rev;
char *name;
unsigned short addr;

superio_enter();
id = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID);
Expand All @@ -371,25 +370,24 @@ static int __init smsc47b397_find(void)
rev = superio_inb(SUPERIO_REG_DEVREV);

superio_select(SUPERIO_REG_LD8);
addr = (superio_inb(SUPERIO_REG_BASE_MSB) << 8)
*addr = (superio_inb(SUPERIO_REG_BASE_MSB) << 8)
| superio_inb(SUPERIO_REG_BASE_LSB);

pr_info("found SMSC %s (base address 0x%04x, revision %u)\n",
name, addr, rev);
name, *addr, rev);

superio_exit();
return addr;
return 0;
}

static int __init smsc47b397_init(void)
{
unsigned short address;
int ret;

ret = smsc47b397_find();
if (ret < 0)
ret = smsc47b397_find(&address);
if (ret)
return ret;
address = ret;

ret = platform_driver_register(&smsc47b397_driver);
if (ret)
Expand Down
19 changes: 9 additions & 10 deletions trunk/drivers/hwmon/smsc47m1.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,10 @@ static const struct attribute_group smsc47m1_group = {
.attrs = smsc47m1_attributes,
};

static int __init smsc47m1_find(struct smsc47m1_sio_data *sio_data)
static int __init smsc47m1_find(unsigned short *addr,
struct smsc47m1_sio_data *sio_data)
{
u8 val;
unsigned short addr;

superio_enter();
val = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID);
Expand Down Expand Up @@ -546,9 +546,9 @@ static int __init smsc47m1_find(struct smsc47m1_sio_data *sio_data)
}

superio_select();
addr = (superio_inb(SUPERIO_REG_BASE) << 8)
*addr = (superio_inb(SUPERIO_REG_BASE) << 8)
| superio_inb(SUPERIO_REG_BASE + 1);
if (addr == 0) {
if (*addr == 0) {
pr_info("Device address not set, will not use\n");
superio_exit();
return -ENODEV;
Expand All @@ -565,7 +565,7 @@ static int __init smsc47m1_find(struct smsc47m1_sio_data *sio_data)
}

superio_exit();
return addr;
return 0;
}

/* Restore device to its initial state */
Expand Down Expand Up @@ -938,15 +938,13 @@ static int __init sm_smsc47m1_init(void)
unsigned short address;
struct smsc47m1_sio_data sio_data;

err = smsc47m1_find(&sio_data);
if (err < 0)
return err;
address = err;
if (smsc47m1_find(&address, &sio_data))
return -ENODEV;

/* Sets global pdev as a side effect */
err = smsc47m1_device_add(address, &sio_data);
if (err)
return err;
goto exit;

err = platform_driver_probe(&smsc47m1_driver, smsc47m1_probe);
if (err)
Expand All @@ -957,6 +955,7 @@ static int __init sm_smsc47m1_init(void)
exit_device:
platform_device_unregister(pdev);
smsc47m1_restore(&sio_data);
exit:
return err;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/of/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int of_gpio_simple_xlate(struct gpio_chip *gc,
if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
return -EINVAL;

if (gpiospec->args[0] >= gc->ngpio)
if (gpiospec->args[0] > gc->ngpio)
return -EINVAL;

if (flags)
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/spi/spi-davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
dev_dbg(sdev, "Couldn't DMA map a %d bytes RX buffer\n",
rx_buf_count);
if (t->tx_buf)
dma_unmap_single(&spi->dev, t->tx_dma, t->len,
dma_unmap_single(NULL, t->tx_dma, t->len,
DMA_TO_DEVICE);
return -ENOMEM;
}
Expand Down Expand Up @@ -692,10 +692,10 @@ static int davinci_spi_bufs(struct spi_device *spi, struct spi_transfer *t)
if (spicfg->io_type == SPI_IO_TYPE_DMA) {

if (t->tx_buf)
dma_unmap_single(&spi->dev, t->tx_dma, t->len,
dma_unmap_single(NULL, t->tx_dma, t->len,
DMA_TO_DEVICE);

dma_unmap_single(&spi->dev, t->rx_dma, rx_buf_count,
dma_unmap_single(NULL, t->rx_dma, rx_buf_count,
DMA_FROM_DEVICE);

clear_io_bits(dspi->base + SPIINT, SPIINT_DMA_REQ_EN);
Expand Down
4 changes: 1 addition & 3 deletions trunk/drivers/spi/spi-fsl-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,10 @@ static void fsl_spi_change_mode(struct spi_device *spi)
static void fsl_spi_chipselect(struct spi_device *spi, int value)
{
struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
struct fsl_spi_platform_data *pdata;
struct fsl_spi_platform_data *pdata = spi->dev.parent->platform_data;
bool pol = spi->mode & SPI_CS_HIGH;
struct spi_mpc8xxx_cs *cs = spi->controller_state;

pdata = spi->dev.parent->parent->platform_data;

if (value == BITBANG_CS_INACTIVE) {
if (pdata->cs_control)
pdata->cs_control(spi, !pol);
Expand Down
Loading

0 comments on commit 6b330e7

Please sign in to comment.