diff options
Diffstat (limited to 'drivers/gpio/gpio-pcf857x.c')
-rw-r--r-- | drivers/gpio/gpio-pcf857x.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c index 12e3e484d70b..16af35cd2b10 100644 --- a/drivers/gpio/gpio-pcf857x.c +++ b/drivers/gpio/gpio-pcf857x.c | |||
@@ -285,7 +285,7 @@ static int pcf857x_probe(struct i2c_client *client, | |||
285 | gpio->chip.ngpio = id->driver_data; | 285 | gpio->chip.ngpio = id->driver_data; |
286 | 286 | ||
287 | /* enable gpio_to_irq() if platform has settings */ | 287 | /* enable gpio_to_irq() if platform has settings */ |
288 | if (pdata->irq) { | 288 | if (pdata && pdata->irq) { |
289 | status = pcf857x_irq_domain_init(gpio, pdata, &client->dev); | 289 | status = pcf857x_irq_domain_init(gpio, pdata, &client->dev); |
290 | if (status < 0) { | 290 | if (status < 0) { |
291 | dev_err(&client->dev, "irq_domain init failed\n"); | 291 | dev_err(&client->dev, "irq_domain init failed\n"); |
@@ -394,7 +394,7 @@ fail: | |||
394 | dev_dbg(&client->dev, "probe error %d for '%s'\n", | 394 | dev_dbg(&client->dev, "probe error %d for '%s'\n", |
395 | status, client->name); | 395 | status, client->name); |
396 | 396 | ||
397 | if (pdata->irq) | 397 | if (pdata && pdata->irq) |
398 | pcf857x_irq_domain_cleanup(gpio); | 398 | pcf857x_irq_domain_cleanup(gpio); |
399 | 399 | ||
400 | kfree(gpio); | 400 | kfree(gpio); |
@@ -418,7 +418,7 @@ static int pcf857x_remove(struct i2c_client *client) | |||
418 | } | 418 | } |
419 | } | 419 | } |
420 | 420 | ||
421 | if (pdata->irq) | 421 | if (pdata && pdata->irq) |
422 | pcf857x_irq_domain_cleanup(gpio); | 422 | pcf857x_irq_domain_cleanup(gpio); |
423 | 423 | ||
424 | status = gpiochip_remove(&gpio->chip); | 424 | status = gpiochip_remove(&gpio->chip); |