Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4847167ybi; Tue, 28 May 2019 03:33:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfrjdVq1/vsy3ISTy88KBSMlvMjnkGEAWaLkm/lzHp9Jtb0Cxt12/basbQP9ByjCezIaS9 X-Received: by 2002:aa7:860a:: with SMTP id p10mr126092747pfn.214.1559039598463; Tue, 28 May 2019 03:33:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559039598; cv=none; d=google.com; s=arc-20160816; b=M9iaPqIY9VlUI8CMmDXx2SoQe4qQwJAtZT9c2n2VdWvl2Qwjbl8gHcu2ga9+pPY1oW UbFJCLnht7meTOz215vNsScu6QFzvC91MIm9h08HQDVv+35fCC6F42BLiX92ayM2B7BD A68c6gyluukULZU/wI50hdMWFCW9pK3hxqfGAykq013l1bsHwKklRo/ERnNflXcc/pOC lcOqXmoKddDaZPwoKc3BLVgS9aUWwjmcx27/bz96/itmzpl4hL37HV2TQNUb3BrWqpgZ DTVcuDUFxKZF2UIHcXR3rFgMuSd8sK9+6DyCRC2xWd+gHn4rFfhRr6wUOamlzHviqIlf CJ8Q== 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=nLIVJNOKPruyL2MbHXck0x1/IdLuH5xoXBTEBJ1A7QE=; b=nSy1cM4NKIVfL+EJnfYAV1T5RAIAw9aks1WlV9jtkRoJxHWv/NmFvdHp70IgHCDBRh tgtBH0/03s+3HgmA/DZXdQBuFpdAm/QJVMScG4P7FtEd81cJmwO4tZTMDkFci+JFT36e GXQFSvdfhJRBAPaHO9QnaCsamg/fD+JoCwEYSRhaSWa2ksCNGgm11Hl8DhcULvzB9r3X LQ2LgpzF+M4TqYri9R0JAmIwvCgTx/8uC2h3NRsFNCzdJEhEeHRxwWxX2SmZ2AUA4B+/ 7MXZh94A9+FvTp6ch/ibXOubp4Iz+qtXTplM+wBOlmvjwpuxB3jX2l0yg8SEEZLTKLcb LO0g== 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 s14si24710874pfc.146.2019.05.28.03.32.49; Tue, 28 May 2019 03:33:18 -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 S1726650AbfE1Kae (ORCPT + 99 others); Tue, 28 May 2019 06:30:34 -0400 Received: from mga03.intel.com ([134.134.136.65]:11633 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbfE1Kae (ORCPT ); Tue, 28 May 2019 06:30:34 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 May 2019 03:30:33 -0700 X-ExtLoop1: 1 Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga001.fm.intel.com with SMTP; 28 May 2019 03:30:28 -0700 Received: by lahna (sSMTP sendmail emulation); Tue, 28 May 2019 13:30:28 +0300 Date: Tue, 28 May 2019 13:30:28 +0300 From: Mika Westerberg To: Charles Keepax Cc: wsa@the-dreams.de, jarkko.nikula@linux.intel.com, andriy.shevchenko@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 v2 2/6] i2c: acpi: Use available IRQ helper functions Message-ID: <20190528103028.GA2781@lahna.fi.intel.com> References: <20190527151932.14310-1-ckeepax@opensource.cirrus.com> <20190527151932.14310-2-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190527151932.14310-2-ckeepax@opensource.cirrus.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 27, 2019 at 04:19:28PM +0100, Charles Keepax wrote: > static int i2c_acpi_get_info(struct acpi_device *adev, > struct i2c_board_info *info, > struct i2c_adapter *adapter, > acpi_handle *adapter_handle) > { > struct list_head resource_list; > - struct resource_entry *entry; > struct i2c_acpi_lookup lookup; > + int irq = -ENOENT; > int ret; > > memset(&lookup, 0, sizeof(lookup)); > @@ -176,16 +187,13 @@ static int i2c_acpi_get_info(struct acpi_device *adev, > > /* Then fill IRQ number if any */ > INIT_LIST_HEAD(&resource_list); > - ret = acpi_dev_get_resources(adev, &resource_list, NULL, NULL); > + ret = acpi_dev_get_resources(adev, &resource_list, > + i2c_acpi_add_resource, &irq); > if (ret < 0) > return -EINVAL; > > - resource_list_for_each_entry(entry, &resource_list) { > - if (resource_type(entry->res) == IORESOURCE_IRQ) { > - info->irq = entry->res->start; > - break; > - } > - } > + if (irq >= 0) Since 0 is not valid IRQ, I think this should be written like: if (irg > 0) > + info->irq = irq; > > acpi_dev_free_resource_list(&resource_list); > > -- > 2.11.0