aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-langwell.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-langwell.c')
-rw-r--r--drivers/gpio/gpio-langwell.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-langwell.c b/drivers/gpio/gpio-langwell.c
index 634c3d37f7b5..62ef10a641c4 100644
--- a/drivers/gpio/gpio-langwell.c
+++ b/drivers/gpio/gpio-langwell.c
@@ -324,6 +324,7 @@ static int lnw_gpio_probe(struct pci_dev *pdev,
324 resource_size_t start, len; 324 resource_size_t start, len;
325 struct lnw_gpio *lnw; 325 struct lnw_gpio *lnw;
326 u32 gpio_base; 326 u32 gpio_base;
327 u32 irq_base;
327 int retval; 328 int retval;
328 int ngpio = id->driver_data; 329 int ngpio = id->driver_data;
329 330
@@ -345,6 +346,7 @@ static int lnw_gpio_probe(struct pci_dev *pdev,
345 retval = -EFAULT; 346 retval = -EFAULT;
346 goto err_ioremap; 347 goto err_ioremap;
347 } 348 }
349 irq_base = *(u32 *)base;
348 gpio_base = *((u32 *)base + 1); 350 gpio_base = *((u32 *)base + 1);
349 /* release the IO mapping, since we already get the info from bar1 */ 351 /* release the IO mapping, since we already get the info from bar1 */
350 iounmap(base); 352 iounmap(base);
@@ -365,13 +367,6 @@ static int lnw_gpio_probe(struct pci_dev *pdev,
365 goto err_ioremap; 367 goto err_ioremap;
366 } 368 }
367 369
368 lnw->domain = irq_domain_add_linear(pdev->dev.of_node, ngpio,
369 &lnw_gpio_irq_ops, lnw);
370 if (!lnw->domain) {
371 retval = -ENOMEM;
372 goto err_ioremap;
373 }
374
375 lnw->reg_base = base; 370 lnw->reg_base = base;
376 lnw->chip.label = dev_name(&pdev->dev); 371 lnw->chip.label = dev_name(&pdev->dev);
377 lnw->chip.request = lnw_gpio_request; 372 lnw->chip.request = lnw_gpio_request;
@@ -384,6 +379,14 @@ static int lnw_gpio_probe(struct pci_dev *pdev,
384 lnw->chip.ngpio = ngpio; 379 lnw->chip.ngpio = ngpio;
385 lnw->chip.can_sleep = 0; 380 lnw->chip.can_sleep = 0;
386 lnw->pdev = pdev; 381 lnw->pdev = pdev;
382
383 lnw->domain = irq_domain_add_simple(pdev->dev.of_node, ngpio, irq_base,
384 &lnw_gpio_irq_ops, lnw);
385 if (!lnw->domain) {
386 retval = -ENOMEM;
387 goto err_ioremap;
388 }
389
387 pci_set_drvdata(pdev, lnw); 390 pci_set_drvdata(pdev, lnw);
388 retval = gpiochip_add(&lnw->chip); 391 retval = gpiochip_add(&lnw->chip);
389 if (retval) { 392 if (retval) {