Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2024674ybi; Thu, 20 Jun 2019 07:56:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJPXKpmAIE+w3156+k9IG1xX1A+AIdA/pNJt21wpxsq8g3NH0kPm9KJUvidLdCdc5IFg98 X-Received: by 2002:a17:902:7887:: with SMTP id q7mr39925373pll.129.1561042566744; Thu, 20 Jun 2019 07:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561042566; cv=none; d=google.com; s=arc-20160816; b=cOnYtSdU7q5lC8PQ3McUZAEsO4ThE5s/adhnrjnBVZCPvqM6ZC/iUSt5EGb1ib+OLg zXGm08cLTxCsW4KIXJhUxjJIa21/W4Gz44Ke82t18jzEc/eVNZsD3C8fyD1py00eOk/p 2zo+zQ73YJsps82PM+XGwR5rw+Iwz0+w7KnqbqyO3LIR2iX9iUSHe6z+L3C42vmH9Vqn KmN+IaSMajIik8y9ApXPx0SHdKvAyyWFkXvDMaOKcAAL43KmD5YXV5y5gLM56a+sbL/u BikM21q4gqOKux7IVcNtB7tw6XVqBhtxYNcczUvYd+IHHgKdU0nhgzVzGjfVhljU9NWK Bx7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=u4MQeY/BUy14Ey5MHkNtP5njF1QivYdD2UznKSMxzbo=; b=FADY3F8VE2OcNbr7GvkSBmTnkALwaBBsHDnmflBTIUco6eXan7GSVtEDeaCK1jdGLO 5QB4Yr2qp+5eWE37/kkedoA3XTw9kBd8sI0cuXWccOaHVjXGFZu7oTsXraTsXlcUuxar ud/wFJXbednS2GR6mz7IDKiooHkb9ITjgr97yrCkLVWEzxFCp6+SEoKQLkPCy6HiADn3 lzub5xWR81WiHrh6crv9uI7ACZo/rj7fzvf1xA3dQo72oGvNi2RmQQoN3eBNYQ3OR49u xYw9UAPz5DsbB//zMa6BF6dc/sbTtMuug/sDTBk4IeewmDcoxg2i+ZLM8vy9rajVR+zD 8i5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4si5747401pgr.150.2019.06.20.07.55.51; Thu, 20 Jun 2019 07:56:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731805AbfFTOyh (ORCPT + 99 others); Thu, 20 Jun 2019 10:54:37 -0400 Received: from mga07.intel.com ([134.134.136.100]:32281 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726686AbfFTOyh (ORCPT ); Thu, 20 Jun 2019 10:54:37 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Jun 2019 07:54:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,397,1557212400"; d="scan'208";a="183091685" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.145]) by fmsmga004.fm.intel.com with ESMTP; 20 Jun 2019 07:54:33 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1hdySO-0001MZ-M0; Thu, 20 Jun 2019 17:54:32 +0300 Date: Thu, 20 Jun 2019 17:54:32 +0300 From: Andy Shevchenko To: Charles Keepax Cc: wsa@the-dreams.de, mika.westerberg@linux.intel.com, jarkko.nikula@linux.intel.com, linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, benjamin.tissoires@redhat.com, jbroadus@gmail.com, patches@opensource.cirrus.com Subject: Re: [PATCH v5 3/7] i2c: acpi: Factor out getting the IRQ from ACPI Message-ID: <20190620145432.GD9224@smile.fi.intel.com> References: <20190620133420.4632-1-ckeepax@opensource.cirrus.com> <20190620133420.4632-4-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190620133420.4632-4-ckeepax@opensource.cirrus.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 20, 2019 at 02:34:16PM +0100, Charles Keepax wrote: > In preparation for future refactoring factor out the fetch of the IRQ > into its own helper function. > +static int i2c_acpi_get_irq(struct acpi_device *adev) > +{ > + struct list_head resource_list; > + int irq = -ENOENT; > + int ret; > + > + INIT_LIST_HEAD(&resource_list); > + > + ret = acpi_dev_get_resources(adev, &resource_list, > + i2c_acpi_add_resource, &irq); > + if (ret < 0) > + return -EINVAL; Can't we return ret value? > + > + acpi_dev_free_resource_list(&resource_list); > + > + return irq; > +} > + ret = i2c_acpi_get_irq(adev); > + if (ret > 0) > + info->irq = ret; And on error we do not bail out. This changes the behaviour. -- With Best Regards, Andy Shevchenko