From patchwork Fri Nov 10 18:11:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 742986 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org [139.178.88.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB25DC4332F for ; Fri, 10 Nov 2023 18:31:31 +0000 (UTC) Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 81B71280F8B for ; Fri, 10 Nov 2023 18:31:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26FEC3A295; Fri, 10 Nov 2023 18:31:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fwXUbv4w" Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15C403A298 for ; Fri, 10 Nov 2023 18:31:29 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB153515EF; Fri, 10 Nov 2023 10:30: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=1699641041; x=1731177041; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=X/xNhyHvFMkgPNj7any9KS/bIKEyL+Njqu+OGpvTT3E=; b=fwXUbv4wLzxoJFpzAPraDOiPXR90UFazMcpvzrb4AD+6j5o+AoGsMPp1 REeKImJGkAEhzow43veh7yhova+BK/XUM1AtoMJqQmjPKBAb1uggdtfup BP8IQ1WvUxWHHZdVzm5xQ3VabPljG1XsJSVGcEqZgBq48Zzsps2xExAn5 IBuwTNrXrVDqzg4JnIxNi67qPoGg0DrA/O/X4O/BIf1h4Xl4p8KIqnc5P NQiz4hXYGUH+xC+NVeanb5t9tY34iNgy1OrblVZn4IvKkw5jqXn9FeoMs +/LG4cetKDXx0G0FkBnCsuleTT+dqeZ3DphTEXy5AIYZl5KOM8tTHv2AX A==; X-IronPort-AV: E=McAfee;i="6600,9927,10890"; a="380606851" X-IronPort-AV: E=Sophos;i="6.03,291,1694761200"; d="scan'208";a="380606851" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2023 10:29:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10890"; a="792912167" X-IronPort-AV: E=Sophos;i="6.03,291,1694761200"; d="scan'208";a="792912167" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 10 Nov 2023 10:29:40 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3F97F8D7; Fri, 10 Nov 2023 20:23:08 +0200 (EET) From: Andy Shevchenko To: Jarkko Nikula , Mario Limonciello , Herbert Xu , Andy Shevchenko , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mika Westerberg , Jan Dabros , Andi Shyti , Philipp Zabel , Hans de Goede Subject: [PATCH v3 20/25] i2c: designware: Uninline i2c_dw_probe() Date: Fri, 10 Nov 2023 20:11:40 +0200 Message-ID: <20231110182304.3894319-21-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231110182304.3894319-1-andriy.shevchenko@linux.intel.com> References: <20231110182304.3894319-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Since i2c_dw_probe() is going to be extended, uninline it to reduce the noise in the common header. Signed-off-by: Andy Shevchenko --- drivers/i2c/busses/i2c-designware-common.c | 14 ++++++++++++++ drivers/i2c/busses/i2c-designware-core.h | 17 ++--------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c index b7e653e939bd..68d6a1c642a0 100644 --- a/drivers/i2c/busses/i2c-designware-common.c +++ b/drivers/i2c/busses/i2c-designware-common.c @@ -713,6 +713,20 @@ void i2c_dw_disable(struct dw_i2c_dev *dev) i2c_dw_release_lock(dev); } +int i2c_dw_probe(struct dw_i2c_dev *dev) +{ + switch (dev->mode) { + case DW_IC_SLAVE: + return i2c_dw_probe_slave(dev); + case DW_IC_MASTER: + return i2c_dw_probe_master(dev); + default: + dev_err(dev->dev, "Wrong operation mode: %d\n", dev->mode); + return -EINVAL; + } +} +EXPORT_SYMBOL_GPL(i2c_dw_probe); + static int i2c_dw_prepare(struct device *device) { /* diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h index f6ebf86dcc6f..7479cb3a450d 100644 --- a/drivers/i2c/busses/i2c-designware-core.h +++ b/drivers/i2c/busses/i2c-designware-core.h @@ -10,9 +10,7 @@ */ #include -#include #include -#include #include #include #include @@ -367,19 +365,6 @@ static inline void i2c_dw_configure_slave(struct dw_i2c_dev *dev) { } static inline int i2c_dw_probe_slave(struct dw_i2c_dev *dev) { return -EINVAL; } #endif -static inline int i2c_dw_probe(struct dw_i2c_dev *dev) -{ - switch (dev->mode) { - case DW_IC_SLAVE: - return i2c_dw_probe_slave(dev); - case DW_IC_MASTER: - return i2c_dw_probe_master(dev); - default: - dev_err(dev->dev, "Wrong operation mode: %d\n", dev->mode); - return -EINVAL; - } -} - static inline void i2c_dw_configure(struct dw_i2c_dev *dev) { if (i2c_detect_slave_mode(dev->dev)) @@ -388,6 +373,8 @@ static inline void i2c_dw_configure(struct dw_i2c_dev *dev) i2c_dw_configure_master(dev); } +int i2c_dw_probe(struct dw_i2c_dev *dev); + #if IS_ENABLED(CONFIG_I2C_DESIGNWARE_BAYTRAIL) int i2c_dw_baytrail_probe_lock_support(struct dw_i2c_dev *dev); #endif