diff options
Diffstat (limited to 'drivers/gpio/gpio-pcf857x.c')
-rw-r--r-- | drivers/gpio/gpio-pcf857x.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c index 16af35cd2b10..a19b7457a726 100644 --- a/drivers/gpio/gpio-pcf857x.c +++ b/drivers/gpio/gpio-pcf857x.c | |||
@@ -223,11 +223,11 @@ static void pcf857x_irq_domain_cleanup(struct pcf857x *gpio) | |||
223 | 223 | ||
224 | static int pcf857x_irq_domain_init(struct pcf857x *gpio, | 224 | static int pcf857x_irq_domain_init(struct pcf857x *gpio, |
225 | struct pcf857x_platform_data *pdata, | 225 | struct pcf857x_platform_data *pdata, |
226 | struct device *dev) | 226 | struct i2c_client *client) |
227 | { | 227 | { |
228 | int status; | 228 | int status; |
229 | 229 | ||
230 | gpio->irq_domain = irq_domain_add_linear(dev->of_node, | 230 | gpio->irq_domain = irq_domain_add_linear(client->dev.of_node, |
231 | gpio->chip.ngpio, | 231 | gpio->chip.ngpio, |
232 | &pcf857x_irq_domain_ops, | 232 | &pcf857x_irq_domain_ops, |
233 | NULL); | 233 | NULL); |
@@ -235,15 +235,15 @@ static int pcf857x_irq_domain_init(struct pcf857x *gpio, | |||
235 | goto fail; | 235 | goto fail; |
236 | 236 | ||
237 | /* enable real irq */ | 237 | /* enable real irq */ |
238 | status = request_irq(pdata->irq, pcf857x_irq_demux, 0, | 238 | status = request_irq(client->irq, pcf857x_irq_demux, 0, |
239 | dev_name(dev), gpio); | 239 | dev_name(&client->dev), gpio); |
240 | if (status) | 240 | if (status) |
241 | goto fail; | 241 | goto fail; |
242 | 242 | ||
243 | /* enable gpio_to_irq() */ | 243 | /* enable gpio_to_irq() */ |
244 | INIT_WORK(&gpio->work, pcf857x_irq_demux_work); | 244 | INIT_WORK(&gpio->work, pcf857x_irq_demux_work); |
245 | gpio->chip.to_irq = pcf857x_to_irq; | 245 | gpio->chip.to_irq = pcf857x_to_irq; |
246 | gpio->irq = pdata->irq; | 246 | gpio->irq = client->irq; |
247 | 247 | ||
248 | return 0; | 248 | return 0; |
249 | 249 | ||
@@ -285,8 +285,8 @@ 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 && pdata->irq) { | 288 | if (pdata && client->irq) { |
289 | status = pcf857x_irq_domain_init(gpio, pdata, &client->dev); | 289 | status = pcf857x_irq_domain_init(gpio, pdata, client); |
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"); |
292 | goto fail; | 292 | goto fail; |
@@ -368,15 +368,6 @@ static int pcf857x_probe(struct i2c_client *client, | |||
368 | if (status < 0) | 368 | if (status < 0) |
369 | goto fail; | 369 | goto fail; |
370 | 370 | ||
371 | /* NOTE: these chips can issue "some pin-changed" IRQs, which we | ||
372 | * don't yet even try to use. Among other issues, the relevant | ||
373 | * genirq state isn't available to modular drivers; and most irq | ||
374 | * methods can't be called from sleeping contexts. | ||
375 | */ | ||
376 | |||
377 | dev_info(&client->dev, "%s\n", | ||
378 | client->irq ? " (irq ignored)" : ""); | ||
379 | |||
380 | /* Let platform code set up the GPIOs and their users. | 371 | /* Let platform code set up the GPIOs and their users. |
381 | * Now is the first time anyone could use them. | 372 | * Now is the first time anyone could use them. |
382 | */ | 373 | */ |
@@ -388,13 +379,15 @@ static int pcf857x_probe(struct i2c_client *client, | |||
388 | dev_warn(&client->dev, "setup --> %d\n", status); | 379 | dev_warn(&client->dev, "setup --> %d\n", status); |
389 | } | 380 | } |
390 | 381 | ||
382 | dev_info(&client->dev, "probed\n"); | ||
383 | |||
391 | return 0; | 384 | return 0; |
392 | 385 | ||
393 | fail: | 386 | fail: |
394 | dev_dbg(&client->dev, "probe error %d for '%s'\n", | 387 | dev_dbg(&client->dev, "probe error %d for '%s'\n", |
395 | status, client->name); | 388 | status, client->name); |
396 | 389 | ||
397 | if (pdata && pdata->irq) | 390 | if (pdata && client->irq) |
398 | pcf857x_irq_domain_cleanup(gpio); | 391 | pcf857x_irq_domain_cleanup(gpio); |
399 | 392 | ||
400 | kfree(gpio); | 393 | kfree(gpio); |
@@ -418,7 +411,7 @@ static int pcf857x_remove(struct i2c_client *client) | |||
418 | } | 411 | } |
419 | } | 412 | } |
420 | 413 | ||
421 | if (pdata && pdata->irq) | 414 | if (pdata && client->irq) |
422 | pcf857x_irq_domain_cleanup(gpio); | 415 | pcf857x_irq_domain_cleanup(gpio); |
423 | 416 | ||
424 | status = gpiochip_remove(&gpio->chip); | 417 | status = gpiochip_remove(&gpio->chip); |