Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5100758ybi; Tue, 28 May 2019 07:33:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqz0DKYL7AtPRVnse1arI6cL0LDYt81ewvV/t4x/WkKQCtXKl4c8BmDwEc1V9Gr+faR3ECsV X-Received: by 2002:a17:902:e104:: with SMTP id cc4mr135303492plb.254.1559054011589; Tue, 28 May 2019 07:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559054011; cv=none; d=google.com; s=arc-20160816; b=UjRbsXnfOuOm4jUjiVl9xUC8ZKFmQyP7TAm8iAy2B/m4/gL2ANGvgABzJm7yA1jSig 2rpJEKNeJemyUAmsO6b5hzZi728Jt8lT5KXYjhJPyLOXUJ3AckJrVL+TcZ6m/IhJ/+ul DpQJOxyaek71euBMvPNsj5grlN12SVNbY4uuU7AEGEGC+qyX2dD4SZDhtcMbaKvBAUPM BpPHzotlWj5wUnjZiPGvGl9mTlHKtrk2W1bXy7wt8ljslDjcFAEr07x7r7GljGlJ4ygh PHSAiNr1skblkVErtydzmx73ALDZSiS9BUnCrbksTyBGF4EUezEFhB8lWE9L+zjvGeu0 tghA== 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=MpqRrXW4z8fY03p6Cb7CL3TUhACRxARrNv0BujU0Rmo=; b=LXgN7feDaT+MBWtJ9BWXOEE8bh9aGNn6KxsDnyFIk1r5iNXE37wvpTIvjIOgvrKW1R gfnic3w6zLfP/gQAHJ44JPkB9P8chGqMctic9Prqcyau0fVXgDTluQrgekGh5cYUCfdY ixP+gZWiibW+qM1sqzqtKAe6pIu+PtVtUM0w6r9WciEnJiM5vLxS/d95nVwgdsw4uKTi H+0T7nmqsKdPek01ivmh3E3W9G5Q7SXW7+hZeet8O0q10mLuZx/YEqaHtffs/ksg1a5i y/1jHAd8jThPxV54QXZzqO/HvNzVOrVIAWNBfOImbpfP/1ZJMHfsQvvudmYmZma3wEYE K+fw== 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 3si22062684pgt.305.2019.05.28.07.33.16; Tue, 28 May 2019 07:33:31 -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 S1726604AbfE1O3f (ORCPT + 99 others); Tue, 28 May 2019 10:29:35 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:58700 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726789AbfE1O3d (ORCPT ); Tue, 28 May 2019 10:29:33 -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 x4SEObVT014409; Tue, 28 May 2019 09:29:02 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail2.cirrus.com (mail2.cirrus.com [141.131.128.20]) by mx0a-001ae601.pphosted.com with ESMTP id 2sq340kgp2-1; Tue, 28 May 2019 09:29:01 -0500 Received: from EDIEX01.ad.cirrus.com (unknown [198.61.84.80]) by mail2.cirrus.com (Postfix) with ESMTP id 452A5605A6B0; Tue, 28 May 2019 09:29:01 -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 15:29:00 +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 15:29:00 +0100 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id A36DE2DA; Tue, 28 May 2019 15:29:00 +0100 (BST) From: Charles Keepax To: , CC: , , , , , , , Subject: [PATCH v3 6/6] i2c: core: Tidy up handling of init_irq Date: Tue, 28 May 2019 15:29:00 +0100 Message-ID: <20190528142900.24147-6-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190528142900.24147-1-ckeepax@opensource.cirrus.com> References: <20190528142900.24147-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=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905280094 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only set init_irq during i2c_device_new and only handle client->irq on the probe/remove paths. Suggested-by: Benjamin Tissoires Signed-off-by: Charles Keepax --- No changes since v2. Thanks, Charles drivers/i2c/i2c-core-base.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 684ea2665d994..6d4904cdf58ac 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -322,6 +322,8 @@ static int i2c_device_probe(struct device *dev) driver = to_i2c_driver(dev->driver); + client->irq = client->init_irq; + if (!client->irq && !driver->disable_i2c_core_irq_mapping) { int irq = -ENOENT; @@ -432,7 +434,7 @@ static int i2c_device_remove(struct device *dev) dev_pm_clear_wake_irq(&client->dev); device_init_wakeup(&client->dev, false); - client->irq = client->init_irq; + client->irq = 0; if (client->flags & I2C_CLIENT_HOST_NOTIFY) pm_runtime_put(&client->adapter->dev); @@ -749,7 +751,6 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf if (!client->init_irq) client->init_irq = i2c_dev_irq_from_resources(info->resources, info->num_resources); - client->irq = client->init_irq; strlcpy(client->name, info->type, sizeof(client->name)); -- 2.11.0