Skip to contentSkip to conversation

onkey: 88pm80x: update irq base

PATCH In review Qing Xu 1 participant 2 messages Dec 3, 2012 – Dec 12, 2012 Input drivers

lore
Share & tools
lore

Qing Xu

author
#0 lore raw

PATCH 3/4 onkey: 88pm80x: update irq base

From: Qing Xu <[email protected]>

irq base is stored in 88pm80x's drv data, we need to add irq base to get the correct irq num

---
 drivers/input/misc/88pm80x_onkey.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
drivers/input/misc/88pm80x_onkey.c +4 -3
index 7f26e7b..cc352f9 100644
@@ -67,7 +67,7 @@ static int __devinit pm80x_onkey_probe(struct platform_device *pdev)
 
 	struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
 	struct pm80x_onkey_info *info;
-	int err;
+	int irq, err;
 
 	info = kzalloc(sizeof(struct pm80x_onkey_info), GFP_KERNEL);
 	if (!info)
@@ -75,13 +75,14 @@ static int __devinit pm80x_onkey_probe(struct platform_device *pdev)
 
 	info->pm80x = chip;
 
-	info->irq = platform_get_irq(pdev, 0);
-	if (info->irq < 0) {
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
 		dev_err(&pdev->dev, "No IRQ resource!\n");
 		err = -EINVAL;
 		goto out;
 	}
 
+	info->irq = irq + chip->irq_base;
 	info->map = info->pm80x->regmap;
 	if (!info->map) {
 		dev_err(&pdev->dev, "no regmap!\n");
Signature · 1 line
1.7.0.4
author
#1 lore raw
Quoted 31 lines · Qing Xu

From: Qing Xu <[email protected]>

irq base is stored in 88pm80x's drv data, we need to add irq base to get the correct irq num

---
  drivers/input/misc/88pm80x_onkey.c |    7 ++++---
  1 files changed, 4 insertions(+), 3 deletions(-)
drivers/input/misc/88pm80x_onkey.c +2 -3
index 7f26e7b..cc352f9 100644
@@ -67,7 +67,7 @@ static int __devinit pm80x_onkey_probe(struct platform_device *pdev)
 
  	struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
  	struct pm80x_onkey_info *info;
-	int err;
+	int irq, err;
 
  	info = kzalloc(sizeof(struct pm80x_onkey_info), GFP_KERNEL);
  	if (!info)
@@ -75,13 +75,14 @@ static int __devinit pm80x_onkey_probe(struct platform_device *pdev)
 
  	info->pm80x = chip;
 
-	info->irq = platform_get_irq(pdev, 0);
-	if (info->irq < 0) {
+	irq = platform_get_irq(pdev, 0);

drivers/input/misc/88pm80x_onkey.c static int __devinit pm80x_onkey_probe(struct platform_device *pdev) · line 88

Quoted 10 lines
drivers/input/misc/88pm80x_onkey.c +2 -0
+	if (irq < 0) {
  		dev_err(&pdev->dev, "No IRQ resource!\n");
  		err = -EINVAL;
  		goto out;
  	}
 
+	info->irq = irq + chip->irq_base;
  	info->map = info->pm80x->regmap;
  	if (!info->map) {
  		dev_err(&pdev->dev, "no regmap!\n");

Samuel,

Could you help to review my patch? Thanks a lot!

Qing