Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752815AbaFDLgM (ORCPT ); Wed, 4 Jun 2014 07:36:12 -0400 Received: from mail.dev.rtsoft.ru ([213.79.90.226]:58890 "EHLO dev.rtsoft.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752718AbaFDLgE (ORCPT ); Wed, 4 Jun 2014 07:36:04 -0400 From: nyushchenko@dev.rtsoft.ru To: Grant Likely , Rob Herring , Benjamin Herrenschmidt , Thomas Gleixner , devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, lugovskoy@dev.rtsoft.ru, Nikita Yushchenko Subject: [PATCH 11/21] mfd: use devm_irq_of_parse_and_map() where appropriate Date: Wed, 4 Jun 2014 15:13:11 +0400 Message-Id: <1401880402-30091-12-git-send-email-nyushchenko@dev.rtsoft.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1401880402-30091-1-git-send-email-nyushchenko@dev.rtsoft.ru> References: <1401880402-30091-1-git-send-email-nyushchenko@dev.rtsoft.ru> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nikita Yushchenko This avoids leak of IRQ mapping on error paths, and makes it possible to use devm_request_irq() without facing unmap-while-handler-installed issues. Signed-off-by: Nikita Yushchenko --- drivers/mfd/max8997.c | 4 +++- drivers/mfd/max8998.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/max8997.c b/drivers/mfd/max8997.c index 8cf7a01..6ae0786 100644 --- a/drivers/mfd/max8997.c +++ b/drivers/mfd/max8997.c @@ -153,7 +153,9 @@ static struct max8997_platform_data *max8997_i2c_parse_dt_pdata( return ERR_PTR(-ENOMEM); } - pd->ono = irq_of_parse_and_map(dev->of_node, 1); + pd->ono = devm_irq_of_parse_and_map(dev, dev->of_node, 1); + if (pd->ono < 0) + return ERR_PTR(pd->ono); /* * ToDo: the 'wakeup' member in the platform data is more of a linux diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c index 592db06..6b62dd7 100644 --- a/drivers/mfd/max8998.c +++ b/drivers/mfd/max8998.c @@ -159,7 +159,9 @@ static struct max8998_platform_data *max8998_i2c_parse_dt_pdata( if (!pd) return ERR_PTR(-ENOMEM); - pd->ono = irq_of_parse_and_map(dev->of_node, 1); + pd->ono = devm_irq_of_parse_and_map(dev, dev->of_node, 1); + if (pd->ono < 0) + return ERR_PTR(pd->ono); /* * ToDo: the 'wakeup' member in the platform data is more of a linux -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/