Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4362471ybi; Tue, 11 Jun 2019 05:32:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqysplobOYu5BLY6nzlZ2+3c+vkv7baIUOpqAR+iZy50rjgf35GvO+KPGU0uADuLX+PpWnvv X-Received: by 2002:a17:90a:2008:: with SMTP id n8mr26189489pjc.4.1560256375594; Tue, 11 Jun 2019 05:32:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560256375; cv=none; d=google.com; s=arc-20160816; b=SbByEgNsGS9KEwSW49PfAjhoK2Y130/3riWz6xq1XZQOO7DSWnxwUnM7sgto3XBkmx mWNTxK8wLyhGjgQPurYhUQLyskSRC9XednnklYQ0Z9sFdRMT0fcco4Q7dGwzBvj7z1tC PUygOFrEvs1NDlHXSE6VPW3pKE+MEKiqTAYOl9icUzRNMTXw1NKj9i9Um/TuErWw+9fh cQd9BxJ0WWLREZRRSyFXPsu/CR6v1CVuzXGKXsECNuhuzjUOiIfpKkgq00YIOhlsZFDD WquDXJmW9szo6BhSpYOJYSJuWf65j2ClcLQUkx+I8Q8BBY6KDDgTCJ9A0AZLHNdWCsJM wJgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=fXokj15t3PxFFQAIphfks5JtVhxARUy+Ks7QOeLevrs=; b=tThzXwl6WbUeDtM0GKjXPWy/W3Z7XBbCM8FmvgEcNERmQl7KoHIT4SX31WAGCBai7S HbmxSYJVW9zX4eHH4CuV3xEGtCBZ+dpGzsrvJ1UKRgBaW7h/VHroVPLcRNZFiT2uY0j/ PQbgEdh6SHAuAjXhM1HQxNBJmF6BoIMU/mzBZl5mbM1w2Ap8P+ybsroCgvCoctbrs7IN WcmIl92TMS2nanVvxvZvKnCxtG2KD8Eu9axJhFIIapHo1xdPDiNpgZzLoKsypEUdk8oJ bBviDCylkr184yCmCUSt0xozYOLtC8lcJfI3T6Wp54hv4qExX3UhaYOeMI7ymSr9L2Nr VjIA== 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 d7si4605838plj.74.2019.06.11.05.32.40; Tue, 11 Jun 2019 05:32:55 -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 S1729381AbfFKMb0 (ORCPT + 99 others); Tue, 11 Jun 2019 08:31:26 -0400 Received: from mx0b-001ae601.pphosted.com ([67.231.152.168]:32808 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727278AbfFKMb0 (ORCPT ); Tue, 11 Jun 2019 08:31:26 -0400 Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5BCTCD9027111; Tue, 11 Jun 2019 07:31:02 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail4.cirrus.com ([87.246.98.35]) by mx0b-001ae601.pphosted.com with ESMTP id 2t09ep3xqh-1; Tue, 11 Jun 2019 07:31:02 -0500 Received: from EDIEX01.ad.cirrus.com (ediex01.ad.cirrus.com [198.61.84.80]) by mail4.cirrus.com (Postfix) with ESMTP id 203C9611C8AF; Tue, 11 Jun 2019 07:31:20 -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, 11 Jun 2019 13:31:01 +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, 11 Jun 2019 13:31:01 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id D09762DB; Tue, 11 Jun 2019 13:31:01 +0100 (BST) From: Charles Keepax To: , CC: , , , , , , , Subject: [PATCH v4 6/7] i2c: core: Move ACPI gpio IRQ handling into i2c_acpi_get_irq Date: Tue, 11 Jun 2019 13:31:00 +0100 Message-ID: <20190611123101.25264-7-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190611123101.25264-1-ckeepax@opensource.cirrus.com> References: <20190611123101.25264-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain 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=897 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906110085 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It makes sense to contain all the ACPI IRQ handling in a single helper function. Reviewed-by: Mika Westerberg Signed-off-by: Charles Keepax --- No change since v3. Thanks, Charles drivers/i2c/i2c-core-acpi.c | 3 +++ drivers/i2c/i2c-core-base.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c index c70228f5349ef..b3ccd2dda0fc1 100644 --- a/drivers/i2c/i2c-core-acpi.c +++ b/drivers/i2c/i2c-core-acpi.c @@ -168,6 +168,9 @@ int i2c_acpi_get_irq(struct i2c_client *client) acpi_dev_free_resource_list(&resource_list); + if (irq == -ENOENT) + irq = acpi_dev_gpio_irq_get(adev, 0); + return irq; } diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 9520bcfc83182..6be2e3a4784fa 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -328,9 +328,6 @@ static int i2c_device_probe(struct device *dev) irq = of_irq_get(dev->of_node, 0); } else if (ACPI_COMPANION(dev)) { irq = i2c_acpi_get_irq(client); - - if (irq == -ENOENT) - irq = acpi_dev_gpio_irq_get(ACPI_COMPANION(dev), 0); } if (irq == -EPROBE_DEFER) return irq; -- 2.11.0