Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212442
b: refs/heads/master
c: f0a7a98
h: refs/heads/master
v: v3
  • Loading branch information
Rabin Vincent authored and Russell King committed Sep 19, 2010
1 parent 8349ed7 commit 47e9005
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f066439cfc37d498a06de76fcab8c21d4094ca64
refs/heads/master: f0a7a98d1d400e2a5fd9a63ed56d30d30f2864cb
8 changes: 8 additions & 0 deletions trunk/drivers/gpio/tc35892-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ static int __devinit tc35892_gpio_probe(struct platform_device *pdev)
goto out_freeirq;
}

if (pdata->setup)
pdata->setup(tc35892, tc35892_gpio->chip.base);

platform_set_drvdata(pdev, tc35892_gpio);

return 0;
Expand All @@ -338,9 +341,14 @@ static int __devinit tc35892_gpio_probe(struct platform_device *pdev)
static int __devexit tc35892_gpio_remove(struct platform_device *pdev)
{
struct tc35892_gpio *tc35892_gpio = platform_get_drvdata(pdev);
struct tc35892 *tc35892 = tc35892_gpio->tc35892;
struct tc35892_gpio_platform_data *pdata = tc35892->pdata->gpio;
int irq = platform_get_irq(pdev, 0);
int ret;

if (pdata->remove)
pdata->remove(tc35892, tc35892_gpio->chip.base);

ret = gpiochip_remove(&tc35892_gpio->chip);
if (ret < 0) {
dev_err(tc35892_gpio->dev,
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/mfd/tc35892.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,13 @@ extern int tc35892_set_bits(struct tc35892 *tc35892, u8 reg, u8 mask, u8 val);
* struct tc35892_gpio_platform_data - TC35892 GPIO platform data
* @gpio_base: first gpio number assigned to TC35892. A maximum of
* %TC35892_NR_GPIOS GPIOs will be allocated.
* @setup: callback for board-specific initialization
* @remove: callback for board-specific teardown
*/
struct tc35892_gpio_platform_data {
int gpio_base;
void (*setup)(struct tc35892 *tc35892, unsigned gpio_base);
void (*remove)(struct tc35892 *tc35892, unsigned gpio_base);
};

/**
Expand Down

0 comments on commit 47e9005

Please sign in to comment.