From patchwork Wed Sep 16 14:24:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 518435 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 16867140134 for ; Thu, 17 Sep 2015 00:25:56 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753965AbbIPOZy (ORCPT ); Wed, 16 Sep 2015 10:25:54 -0400 Received: from mga09.intel.com ([134.134.136.24]:36268 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754346AbbIPOZx (ORCPT ); Wed, 16 Sep 2015 10:25:53 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 16 Sep 2015 07:25:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,539,1437462000"; d="scan'208";a="805714957" Received: from black.fi.intel.com ([10.237.72.93]) by orsmga002.jf.intel.com with ESMTP; 16 Sep 2015 07:24:06 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C45C0117; Wed, 16 Sep 2015 17:24:05 +0300 (EEST) From: Andy Shevchenko To: linux-i2c@vger.kernel.org, Wolfram Sang , Neil Horman , Mika Westerberg Cc: Andy Shevchenko Subject: [PATCH 5/6] i2c: ismt: issue a warning when fail to request MSI Date: Wed, 16 Sep 2015 17:24:02 +0300 Message-Id: <1442413443-123579-5-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.5.1 In-Reply-To: <1442413443-123579-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1442413443-123579-1-git-send-email-andriy.shevchenko@linux.intel.com> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Issue the warning in all error paths when unable to register MSI or its handler. Signed-off-by: Andy Shevchenko --- drivers/i2c/busses/i2c-ismt.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c index 3bc4bad..48e0693 100644 --- a/drivers/i2c/busses/i2c-ismt.c +++ b/drivers/i2c/busses/i2c-ismt.c @@ -788,11 +788,8 @@ static int ismt_int_init(struct ismt_priv *priv) /* Try using MSI interrupts */ err = pci_enable_msi(priv->pci_dev); - if (err) { - dev_warn(&priv->pci_dev->dev, - "Unable to use MSI interrupts, falling back to legacy\n"); + if (err) goto intx; - } err = devm_request_irq(&priv->pci_dev->dev, priv->pci_dev->irq, @@ -805,10 +802,13 @@ static int ismt_int_init(struct ismt_priv *priv) goto intx; } - goto done; + return 0; /* Try using legacy interrupts */ intx: + dev_warn(&priv->pci_dev->dev, + "Unable to use MSI interrupts, falling back to legacy\n"); + err = devm_request_irq(&priv->pci_dev->dev, priv->pci_dev->irq, ismt_do_interrupt, @@ -820,7 +820,6 @@ intx: return err; } -done: return 0; }