From patchwork Tue Jun 18 10:01:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J, KEERTHY" X-Patchwork-Id: 2740311 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8A6B89F3A0 for ; Tue, 18 Jun 2013 10:13:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 718BE2036D for ; Tue, 18 Jun 2013 10:13:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4040620369 for ; Tue, 18 Jun 2013 10:13:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756004Ab3FRKMq (ORCPT ); Tue, 18 Jun 2013 06:12:46 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:58889 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755971Ab3FRKMn (ORCPT ); Tue, 18 Jun 2013 06:12:43 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r5IACUFK009625; Tue, 18 Jun 2013 05:12:30 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r5IACU3e010237; Tue, 18 Jun 2013 05:12:30 -0500 Received: from dlelxv22.itg.ti.com (172.17.1.197) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Tue, 18 Jun 2013 05:12:29 -0500 Received: from ubuntu.apr.dhcp.ti.com (ubuntu-172024158172.apr.dhcp.ti.com [172.24.158.172]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r5IACGaJ002036; Tue, 18 Jun 2013 05:12:26 -0500 From: J Keerthy To: CC: , , , , , , , , Subject: [PATCH v2 1/4] MFD: Palmas: Check if interrupts property exists and then only request irq Date: Tue, 18 Jun 2013 15:31:29 +0530 Message-ID: <1371549692-7361-2-git-send-email-j-keerthy@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1371549692-7361-1-git-send-email-j-keerthy@ti.com> References: <1371549692-7361-1-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Check if interrupts property exists and then only request irq. On some boards INT line might not be connected to a valid irq line on the application processor. Hence keeping a check before requesting irq. Boot tested on OMAP5-UEVM board. Signed-off-by: J Keerthy --- drivers/mfd/palmas.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 62fa728..69c4e62 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -236,6 +236,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c, { struct palmas *palmas; struct palmas_platform_data *pdata; + struct device_node *regnode = NULL; struct device_node *node = i2c->dev.of_node; int ret = 0, i; unsigned int reg, addr; @@ -262,7 +263,6 @@ static int palmas_i2c_probe(struct i2c_client *i2c, i2c_set_clientdata(i2c, palmas); palmas->dev = &i2c->dev; palmas->id = id->driver_data; - palmas->irq = i2c->irq; for (i = 0; i < PALMAS_NUM_CLIENTS; i++) { if (i == 0) @@ -290,6 +290,15 @@ static int palmas_i2c_probe(struct i2c_client *i2c, } } + regnode = of_parse_phandle(node, "interrupts", 0); + + if (!regnode) { + dev_warn(palmas->dev, "IRQ missing: skipping irq request\n"); + goto no_irq; + } else { + palmas->irq = i2c->irq; + } + /* Change interrupt line output polarity */ if (pdata->irq_flags & IRQ_TYPE_LEVEL_HIGH) reg = PALMAS_POLARITY_CTRL_INT_POLARITY; @@ -316,6 +325,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c, if (ret < 0) goto err; +no_irq: slave = PALMAS_BASE_TO_SLAVE(PALMAS_PU_PD_OD_BASE); addr = PALMAS_BASE_TO_REG(PALMAS_PU_PD_OD_BASE, PALMAS_PRIMARY_SECONDARY_PAD1);