From patchwork Thu Nov 9 18:19:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 163542 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp625571vqs; Thu, 9 Nov 2023 10:29:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFyhAQ/CaCW929PU8lyZoNE34wgjx2dnp/jobamsn/u4I+rFiDme5Ofyihmbzsgx0GxNSLB X-Received: by 2002:a17:90b:17ce:b0:280:145d:510d with SMTP id me14-20020a17090b17ce00b00280145d510dmr2490854pjb.31.1699554571599; Thu, 09 Nov 2023 10:29:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699554571; cv=none; d=google.com; s=arc-20160816; b=lzJGo4LmoE0LOvdz0tiCGzEVRvSx6JPmehKDB/ikq8o2b9vA/si8ycQRH+bcakz9dE PcprspxhjE5L+SB1N2inH02tRK7CY+F6JvpHM5duxa8qhHHCvLgyjUyKmmFKv6CVOBwH ngGxMNYiMjIhSxYLfu2M8onZtkNW3G98x7LOxkxTpmygHe0CdaqxcKCPHj1PhbK48EjG ikZTdivDWiaKdsqYAcANEg7h5AQFGpfHKmfClajtvVIlT3JHgdTLoP4ECp0f9rEkwM45 qO2qXTnKLbxdeZ3fjtVazakpiaBbTOh1iy3Tp1CsUN8CXnz5YSuVjFhmwvCHh7NB0ui6 xSpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=a3JmKnu6LSzY03FtaJazvbz6HY7IEezGoNrB0BSqW2E=; fh=mq6/FMGJdqTI0UuZRoAMccy9L/KbJAT6TPJFW+BrH4Y=; b=By119JL2UvyNlJPwQ9oty5YGyqFDK5Ue2/fWSDJvgOPsrTmF3CH2zNbqqBek9tyEJn VOIqAofouLpAZCwOl2wWLu6f2e/X64fNj7A5gUDNfzao4yXRW7+KL4O9q8UCh2z3Mzho c9e3udnsMfGmva6jTBxqdL+eTojvY0xnYSxYIUuW3ihqURUGNLah2aAUlYtgelVd8qV7 PAGXr82/ri0mvEFeTSR2FYurr6qoRwy38v4pkZTVYACiGj/hax41vxBZrf3lWqHSKCJz iqJwKqhf+pmGp7PW80P3eyIXnqyI2qSTCxzBlZ2I3KOiGWgtqe/2l4fVXpFPS45DvXH/ 3v7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PI3ARvF1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id mw16-20020a17090b4d1000b00274e5b20e65si2326238pjb.50.2023.11.09.10.29.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 10:29:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=PI3ARvF1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 1C81A838F87A; Thu, 9 Nov 2023 10:29:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345020AbjKIS3G (ORCPT + 31 others); Thu, 9 Nov 2023 13:29:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345023AbjKIS2o (ORCPT ); Thu, 9 Nov 2023 13:28:44 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F5A83C10; Thu, 9 Nov 2023 10:28:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699554521; x=1731090521; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Op42QzcX29hTZKyxHgP0Z66kpzENonKgZWt0vi7oOwE=; b=PI3ARvF1I8CIboEmFgiga+3aH6RIxT6IYpDIzkOHPFk4g+2Zh9PlxMnT y7FNTlQJb+7Qy+rhoexP/I1QjQpfFQONQhdL77JQ4rSzsKPxg3nK2MjMO mTOzfZOxuFeKah6n0Hcb5ZOL3mu+TD0Qno38sSJ8r/w1+DDP8gFoya7HJ rO7NkPReVkWqFjk7R3+VHaBgTkFTWjuhzKWqngpwEJOHM5kDf+AiQtDVk I39Hhp1f08tqVawe0iE2FHApCg5evjutApXj4A1CLrJbtWwbbUW8aENiw miwKUotQHZ5W5OuuZr4kJHle9UAoFsiRK2FQyJfO+T1R1l4PyVVOC5vk+ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10889"; a="375088706" X-IronPort-AV: E=Sophos;i="6.03,290,1694761200"; d="scan'208";a="375088706" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2023 10:28:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10889"; a="767086850" X-IronPort-AV: E=Sophos;i="6.03,290,1694761200"; d="scan'208";a="767086850" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 09 Nov 2023 10:28:37 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id DE3E9823; Thu, 9 Nov 2023 20:28:32 +0200 (EET) From: Andy Shevchenko To: Jarkko Nikula , Herbert Xu , Mario Limonciello , Andy Shevchenko , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mika Westerberg , Jan Dabros , Andi Shyti , Hans de Goede Subject: [PATCH v2 11/12] i2c: designware: Remove ->disable() callback Date: Thu, 9 Nov 2023 20:19:21 +0200 Message-ID: <20231109182823.3531846-12-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1996.gbec44491f096 In-Reply-To: <20231109182823.3531846-1-andriy.shevchenko@linux.intel.com> References: <20231109182823.3531846-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 09 Nov 2023 10:29:13 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782112134473448592 X-GMAIL-MSGID: 1782112134473448592 Commit 90312351fd1e ("i2c: designware: MASTER mode as separated driver") introduced ->disable() callback but there is no real use for it. Both i2c-designware-master.c and i2c-designware-slave.c set it to the same i2c_dw_disable() and scope is inside the same kernel module. That said, replace the callback by explicitly calling the i2c_dw_disable(). Signed-off-by: Andy Shevchenko --- drivers/i2c/busses/i2c-designware-core.h | 2 -- drivers/i2c/busses/i2c-designware-master.c | 1 - drivers/i2c/busses/i2c-designware-pcidrv.c | 5 +++-- drivers/i2c/busses/i2c-designware-platdrv.c | 4 ++-- drivers/i2c/busses/i2c-designware-slave.c | 1 - 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h index 9f8e5bf61ec0..a22f2cd5faf8 100644 --- a/drivers/i2c/busses/i2c-designware-core.h +++ b/drivers/i2c/busses/i2c-designware-core.h @@ -236,7 +236,6 @@ struct reset_control; * @semaphore_idx: Index of table with semaphore type attached to the bus. It's * -1 if there is no semaphore. * @shared_with_punit: true if this bus is shared with the SoC's PUNIT - * @disable: function to disable the controller * @init: function to initialize the I2C hardware * @set_sda_hold_time: callback to retrieve IP specific SDA hold timing * @mode: operation mode - DW_IC_MASTER or DW_IC_SLAVE @@ -293,7 +292,6 @@ struct dw_i2c_dev { void (*release_lock)(void); int semaphore_idx; bool shared_with_punit; - void (*disable)(struct dw_i2c_dev *dev); int (*init)(struct dw_i2c_dev *dev); int (*set_sda_hold_time)(struct dw_i2c_dev *dev); int mode; diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c index 9d06dd7ffe37..4ef4160db01f 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -993,7 +993,6 @@ int i2c_dw_probe_master(struct dw_i2c_dev *dev) init_completion(&dev->cmd_complete); dev->init = i2c_dw_init_master; - dev->disable = i2c_dw_disable; ret = i2c_dw_init_regmap(dev); if (ret) diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c index 68c2e1a3a035..b8bf4ae4fab1 100644 --- a/drivers/i2c/busses/i2c-designware-pcidrv.c +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c @@ -198,7 +198,7 @@ static int __maybe_unused i2c_dw_pci_runtime_suspend(struct device *dev) { struct dw_i2c_dev *i_dev = dev_get_drvdata(dev); - i_dev->disable(i_dev); + i2c_dw_disable(i_dev); return 0; } @@ -345,7 +345,8 @@ static void i2c_dw_pci_remove(struct pci_dev *pdev) { struct dw_i2c_dev *dev = pci_get_drvdata(pdev); - dev->disable(dev); + i2c_dw_disable(dev); + pm_runtime_forbid(&pdev->dev); pm_runtime_get_noresume(&pdev->dev); diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 92e9199a5fdb..d7c39ef16a32 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c @@ -331,7 +331,7 @@ static void dw_i2c_plat_remove(struct platform_device *pdev) i2c_del_adapter(&dev->adapter); - dev->disable(dev); + i2c_dw_disable(dev); pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_put_sync(&pdev->dev); @@ -360,7 +360,7 @@ static int dw_i2c_plat_runtime_suspend(struct device *dev) if (i_dev->shared_with_punit) return 0; - i_dev->disable(i_dev); + i2c_dw_disable(i_dev); i2c_dw_prepare_clk(i_dev, false); return 0; diff --git a/drivers/i2c/busses/i2c-designware-slave.c b/drivers/i2c/busses/i2c-designware-slave.c index 0fa3a3d7a724..8921f6d49129 100644 --- a/drivers/i2c/busses/i2c-designware-slave.c +++ b/drivers/i2c/busses/i2c-designware-slave.c @@ -239,7 +239,6 @@ int i2c_dw_probe_slave(struct dw_i2c_dev *dev) int ret; dev->init = i2c_dw_init_slave; - dev->disable = i2c_dw_disable; ret = i2c_dw_init_regmap(dev); if (ret)