Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4886890ybi; Tue, 28 May 2019 04:15:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQaB4Co9N0MHeHE02GBNu+Xg1diT5nxYVuM0X9n8fmp21W+uo3WH/JRKv9GwLWLqGSroPY X-Received: by 2002:a17:902:a60e:: with SMTP id u14mr128333471plq.94.1559042150848; Tue, 28 May 2019 04:15:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559042150; cv=none; d=google.com; s=arc-20160816; b=ZILhZW3VdfMv7/VTr8UjtiSBZziKgGt+pJmIDiX9tEHCu+ycX0jGJItVusj3CgQgCX IPOnv2NGeQspw4JDD9XLpKXvm0Kn9q8XkZrSHgmQEf22OsAiqTUQ6tdIOAqi+QqyJ/bB rONwl6hWBRL1jhAVRs0PfJwQhPLXK88hnCDm7hNeqKYrnsaz85oTa1iWOcPFDLawTt5d vb0MvR5VH3Kcyu6ij028UijszRpITT2ukH0BollP6w7jq2gFZnmWzPFCtaQlKSu7gUV4 ebsJbIaNmZjah8jZiK6PH20ohX8Pr/Fdo7zveBUGu4iaM1taR/oRQHWOETvfDxzKYPHB IrRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=YMH4JJA9vZFvlXSFti8WpOHqDoq5H54eSqBoPpkt+74=; b=bImUFKAwXcDrazdFmV8SCuXNJk8Ghvb05HWhs+EvQLzOU12C23OHwskYdaK2TtSbGS qziPJDFgpm3SU3RM9k4iI4u7EirPNJ/vuD70hZkq5krhpZgcQjwzTxV/QwwTY1L/XdnB EjIGTuAS9h9C+T4nLAka6THYUxYVzOjgFoJuK6MHA5H1U/0rInUvPu36wkjL7cHDi0Up 8J50cI2xHu6kl7Jnbhj/Pbf5Nt8gdXKp0W7a0pLEAG0mID9S9e7CLxHvA4GpP5tTyDBR 9hv5YW00aY8+8Vd0K1gBEvvHHPu/0i8O7AB5OamROsXMSgKoP/Is0Vfb3vBYKCA8ibb9 xS1g== 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=opensource.cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si7714205pgb.41.2019.05.28.04.15.34; Tue, 28 May 2019 04:15:50 -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=opensource.cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726574AbfE1LOX (ORCPT + 99 others); Tue, 28 May 2019 07:14:23 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:44280 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726345AbfE1LOX (ORCPT ); Tue, 28 May 2019 07:14:23 -0400 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4SB9FKR016551; Tue, 28 May 2019 06:13:10 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail1.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0a-001ae601.pphosted.com with ESMTP id 2sq340k99g-1; Tue, 28 May 2019 06:13:10 -0500 Received: from EDIEX01.ad.cirrus.com (unknown [198.61.84.80]) by mail1.cirrus.com (Postfix) with ESMTP id 8C146611C8C0; Tue, 28 May 2019 06:13:09 -0500 (CDT) Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Tue, 28 May 2019 12:13:08 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1591.10 via Frontend Transport; Tue, 28 May 2019 12:13:08 +0100 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id D534745; Tue, 28 May 2019 12:13:08 +0100 (BST) Date: Tue, 28 May 2019 12:13:08 +0100 From: Charles Keepax To: Mika Westerberg CC: , , , , , , , , Subject: Re: [PATCH v2 2/6] i2c: acpi: Use available IRQ helper functions Message-ID: <20190528111308.GF28362@ediswmail.ad.cirrus.com> References: <20190527151932.14310-1-ckeepax@opensource.cirrus.com> <20190527151932.14310-2-ckeepax@opensource.cirrus.com> <20190528103028.GA2781@lahna.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190528103028.GA2781@lahna.fi.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=889 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905280073 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 28, 2019 at 01:30:28PM +0300, Mika Westerberg wrote: > 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) > Yeah sorry thought IRQs were like GPIOs where 0 is a valid number, will update the patches. Thanks, Charles > > + info->irq = irq; > > > > acpi_dev_free_resource_list(&resource_list); > > > > -- > > 2.11.0