From patchwork Mon Jul 30 12:38:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 950865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41fJyb3zd6z9s0R for ; Mon, 30 Jul 2018 22:38:31 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729093AbeG3ONR (ORCPT ); Mon, 30 Jul 2018 10:13:17 -0400 Received: from mga12.intel.com ([192.55.52.136]:44792 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbeG3ONR (ORCPT ); Mon, 30 Jul 2018 10:13:17 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2018 05:38:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,422,1526367600"; d="scan'208";a="220255201" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 30 Jul 2018 05:38:28 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1ED23F7; Mon, 30 Jul 2018 15:38:38 +0300 (EEST) From: Andy Shevchenko To: linux-gpio@vger.kernel.org, Linus Walleij Cc: Andy Shevchenko , Hoan Tran Subject: [PATCH v1 4/8] gpio: dwapb: Don't shadow error code of gpiochip_lock_as_irq() Date: Mon, 30 Jul 2018 15:38:33 +0300 Message-Id: <20180730123837.3936-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180730123837.3936-1-andriy.shevchenko@linux.intel.com> References: <20180730123837.3936-1-andriy.shevchenko@linux.intel.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org gpiochip_lock_as_irq() may return a few error codes, do not shadow them by -EINVAL and let caller to decide. No functional change intended. Cc: Hoan Tran Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-dwapb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 7a2de3de6571..28da700f5f52 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -255,11 +255,13 @@ static int dwapb_irq_reqres(struct irq_data *d) struct irq_chip_generic *igc = irq_data_get_irq_chip_data(d); struct dwapb_gpio *gpio = igc->private; struct gpio_chip *gc = &gpio->ports[0].gc; + int ret; - if (gpiochip_lock_as_irq(gc, irqd_to_hwirq(d))) { + ret = gpiochip_lock_as_irq(gc, irqd_to_hwirq(d)); + if (ret) { dev_err(gpio->dev, "unable to lock HW IRQ %lu for IRQ\n", irqd_to_hwirq(d)); - return -EINVAL; + return ret; } return 0; }