Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208476
b: refs/heads/master
c: 49946f6
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Eremin-Solenikov authored and Linus Torvalds committed Aug 11, 2010
1 parent 6752344 commit d726340
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 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: 4a22b8a4ad5561436b16f5278d2f9e406ffb8705
refs/heads/master: 49946f68149a723659eca253376ac555d4b73280
9 changes: 4 additions & 5 deletions trunk/drivers/gpio/pcf857x.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ static int pcf857x_probe(struct i2c_client *client,
pdata = client->dev.platform_data;
if (!pdata) {
dev_dbg(&client->dev, "no platform data\n");
return -EINVAL;
}

/* Allocate, initialize, and register this gpio_chip. */
Expand All @@ -200,7 +199,7 @@ static int pcf857x_probe(struct i2c_client *client,

mutex_init(&gpio->lock);

gpio->chip.base = pdata->gpio_base;
gpio->chip.base = pdata ? pdata->gpio_base : -1;
gpio->chip.can_sleep = 1;
gpio->chip.dev = &client->dev;
gpio->chip.owner = THIS_MODULE;
Expand Down Expand Up @@ -278,7 +277,7 @@ static int pcf857x_probe(struct i2c_client *client,
* to zero, our software copy of the "latch" then matches the chip's
* all-ones reset state. Otherwise it flags pins to be driven low.
*/
gpio->out = ~pdata->n_latch;
gpio->out = pdata ? ~pdata->n_latch : ~0;

status = gpiochip_add(&gpio->chip);
if (status < 0)
Expand All @@ -299,7 +298,7 @@ static int pcf857x_probe(struct i2c_client *client,
/* Let platform code set up the GPIOs and their users.
* Now is the first time anyone could use them.
*/
if (pdata->setup) {
if (pdata && pdata->setup) {
status = pdata->setup(client,
gpio->chip.base, gpio->chip.ngpio,
pdata->context);
Expand All @@ -322,7 +321,7 @@ static int pcf857x_remove(struct i2c_client *client)
struct pcf857x *gpio = i2c_get_clientdata(client);
int status = 0;

if (pdata->teardown) {
if (pdata && pdata->teardown) {
status = pdata->teardown(client,
gpio->chip.base, gpio->chip.ngpio,
pdata->context);
Expand Down

0 comments on commit d726340

Please sign in to comment.