From patchwork Mon Apr 14 10:01:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 14050090 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 D868C25E47F; Mon, 14 Apr 2025 10:04:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625062; cv=none; b=Ezu6x0muM6JfT9fCQoZhE6Q9VFWe0k+ZUw5L2vM0BGzVML89W09iUOdoBb5vJ10VcQj1fwUTeNdhC6GlWio+rKb2xon0YYV/j4/pB3oiPZ7fZD6dwucam5er+IOHFPpp7+N3PGylTxU2NmAEGfFwJicUTPEwnTwOwCfJA3+eVsc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625062; c=relaxed/simple; bh=ePHhqI9hu+n6tZEJhbHqhlZGeiDxvd33Qi45kz+hnIY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UDYAUsfFhKk2vjNddu/uHDFguRYo27I5eHFX6yDaEdwCEYNfjBLHVIeDzQ9o3JYZRkyLE42/M6QechpUJS8zhw9EEcPaFGEimIuSOuv6LVEg+escGfanS4MtZVMcF3F6nHUQAzmZBLQRBchVlNgpID18IiJdQqRbkLY4tpL1g8M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=CPwcXMBh; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CPwcXMBh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744625060; x=1776161060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ePHhqI9hu+n6tZEJhbHqhlZGeiDxvd33Qi45kz+hnIY=; b=CPwcXMBh/CDz2zskngxx7D1QGm6rBucDk3APy6w3rB7uhU44IXILZGWW 1hbG/jwOSAGTYE+x7k2PdjjXVr8XE1LwuoD+kZScFsRe+7raKurpKJA1H /cfg/sujOwyN+gcb0IFRghPSx6hYIr2Asu5Awnkrs06nK8jMbwxa/9IfH 44fOLAZYS6YrNDt3fk+LVipq66Z8ucd1XP/V+Be3CHm+VjOYnz7N+26VF ILPVlW63wsAyhvwmsSzyOBiy6ppHpUkSb/HA8XQ+TyXhRvRYFL0pX25cM jYijFhhGw3VWipmzl7NYbz8kYCobNt9DyMknNlDTnZDAc4HNyqQO9tTcB g==; X-CSE-ConnectionGUID: y2j4/SR5SR2nnDFMRPmVqQ== X-CSE-MsgGUID: vQ8VGCfuQJqV1SYb8F566Q== X-IronPort-AV: E=McAfee;i="6700,10204,11402"; a="46177062" X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="46177062" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2025 03:04:16 -0700 X-CSE-ConnectionGUID: KvEKAKpeQ9uggmWlMc+kAA== X-CSE-MsgGUID: yGcfJo0KQHG2EQg6V62NgA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="130100420" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa008.fm.intel.com with ESMTP; 14 Apr 2025 03:04:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id CD9E920B; Mon, 14 Apr 2025 13:04:11 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Mauro Carvalho Chehab , Tomi Valkeinen , Jai Luthra , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab Subject: [PATCH v4 1/7] i2c: core: Drop duplicate check before calling OF APIs Date: Mon, 14 Apr 2025 13:01:51 +0300 Message-ID: <20250414100409.3910312-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> References: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 OF APIs are usually NULL-aware and return an error in case when device node is not present or supported. We already have a check for the returned value, no need to check for the parameter. Tested-by: Tomi Valkeinen Reviewed-by: Sakari Ailus Acked-by: Sakari Ailus Signed-off-by: Andy Shevchenko --- drivers/i2c/i2c-core-base.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 7ad1ad5c8c3f..c14ffd6190d3 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -1209,11 +1209,9 @@ struct i2c_client *i2c_new_ancillary_device(struct i2c_client *client, u32 addr = default_addr; int i; - if (np) { - i = of_property_match_string(np, "reg-names", name); - if (i >= 0) - of_property_read_u32_index(np, "reg", i, &addr); - } + i = of_property_match_string(np, "reg-names", name); + if (i >= 0) + of_property_read_u32_index(np, "reg", i, &addr); dev_dbg(&client->adapter->dev, "Address for %s : 0x%x\n", name, addr); return i2c_new_dummy_device(client->adapter, addr); @@ -1651,12 +1649,10 @@ int i2c_add_adapter(struct i2c_adapter *adapter) struct device *dev = &adapter->dev; int id; - if (dev->of_node) { - id = of_alias_get_id(dev->of_node, "i2c"); - if (id >= 0) { - adapter->nr = id; - return __i2c_add_numbered_adapter(adapter); - } + id = of_alias_get_id(dev->of_node, "i2c"); + if (id >= 0) { + adapter->nr = id; + return __i2c_add_numbered_adapter(adapter); } mutex_lock(&core_lock); From patchwork Mon Apr 14 10:01:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 14050091 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 A96A9267B77; Mon, 14 Apr 2025 10:04:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625063; cv=none; b=qyC0jaK3MxgmuXHL7gFJAbRaz9zygiZLOGGgmxpf27tXTcZ/yswaqXSKi36ewSqz2F0BnyP0rRdCHwumQ1SmsHhAWxEr/jXt2CWYZvr0O34bvgcuknujR4Jblyaqa49dwgSgE2lX+LL++iWLDyLp43u1QLeziDwljYr32FKCUM8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625063; c=relaxed/simple; bh=iKkbduU5FktPbfBWny9kkTItLOd1rfa8hx9agx1bUrI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TDYTQzvhqyKSdMTh6z8Cky75esH0vCtU1jLjJvMz/wIubb5KlPI4Gjyy0u5ocnigSO+DLzd5Lz2Y32DvtPrf7LnNjrcNUuYOnF8mw8aLTcGwE5T0SUVXjHNOXfrhUdJL6wWN6xtblSecxYC+ANBFja/M+VQbV8DeFwPxLdtTR7U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UvSSLVTR; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UvSSLVTR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744625062; x=1776161062; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iKkbduU5FktPbfBWny9kkTItLOd1rfa8hx9agx1bUrI=; b=UvSSLVTRfu7JpxJMAx68jkeGc1wOHfk1N/rXO/+bphQFlreBgWyClTHy eWtAnZhHn69G5quk1aL5LjQC/Eho/h4KZOHVeg/6WYZ+tIKp++tYH6Z2G 3oNZomZ4r5kuiimOaKUP+g6EQla0IInMHRgR1Eh0APIxeB5OPcrnMXk85 CKfUwWuUgEIdihtVSXP3ppvf5Fv0SbPc6da0FgPVVvoBn7TRB9YmBfxpn bwd5LNrWSBdV9VflZdrYrphEfKWJwczszv4Rltzsy98/gJY0m5XVGuWb9 n4LksPQtII4jIxQfYKdXKadUDq3xHVeLFXPuqEUhNlRIpwrbExWJZ81qQ g==; X-CSE-ConnectionGUID: iESIgSfwQ9qUaLkWVSqxpg== X-CSE-MsgGUID: h5LHZo/2RH6Bchvl6cllHA== X-IronPort-AV: E=McAfee;i="6700,10204,11402"; a="56747126" X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="56747126" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2025 03:04:16 -0700 X-CSE-ConnectionGUID: frY3m25kSzK1mWl6UBGsYw== X-CSE-MsgGUID: sG9sazP4ShiZEDqTJNA12w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="134747318" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 14 Apr 2025 03:04:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D9A19AB6; Mon, 14 Apr 2025 13:04:11 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Mauro Carvalho Chehab , Tomi Valkeinen , Jai Luthra , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab Subject: [PATCH v4 2/7] i2c: core: Unify the firmware node type check Date: Mon, 14 Apr 2025 13:01:52 +0300 Message-ID: <20250414100409.3910312-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> References: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 OF and ACPI currently are using asymmetrical APIs to check for the firmware node type. Unify them by using is_*_node() against struct fwnode_handle pointer. Tested-by: Tomi Valkeinen Reviewed-by: Sakari Ailus Acked-by: Sakari Ailus Signed-off-by: Andy Shevchenko --- drivers/i2c/i2c-core-base.c | 14 ++++++++------ drivers/i2c/i2c-core-slave.c | 12 ++++++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index c14ffd6190d3..edab56e5d5e5 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -490,6 +490,7 @@ static int i2c_smbus_host_notify_to_irq(const struct i2c_client *client) static int i2c_device_probe(struct device *dev) { + struct fwnode_handle *fwnode = dev_fwnode(dev); struct i2c_client *client = i2c_verify_client(dev); struct i2c_driver *driver; bool do_power_on; @@ -508,11 +509,11 @@ static int i2c_device_probe(struct device *dev) /* Keep adapter active when Host Notify is required */ pm_runtime_get_sync(&client->adapter->dev); irq = i2c_smbus_host_notify_to_irq(client); - } else if (dev->of_node) { + } else if (is_of_node(fwnode)) { irq = of_irq_get_byname(dev->of_node, "irq"); if (irq == -EINVAL || irq == -ENODATA) irq = of_irq_get(dev->of_node, 0); - } else if (ACPI_COMPANION(dev)) { + } else if (is_acpi_device_node(fwnode)) { bool wake_capable; irq = i2c_acpi_get_irq(client, &wake_capable); @@ -1054,15 +1055,16 @@ EXPORT_SYMBOL_GPL(i2c_new_client_device); */ void i2c_unregister_device(struct i2c_client *client) { + struct fwnode_handle *fwnode; + if (IS_ERR_OR_NULL(client)) return; - if (client->dev.of_node) { + fwnode = dev_fwnode(&client->dev); + if (is_of_node(fwnode)) { of_node_clear_flag(client->dev.of_node, OF_POPULATED); of_node_put(client->dev.of_node); - } - - if (ACPI_COMPANION(&client->dev)) + } else if (is_acpi_device_node(fwnode)) acpi_device_clear_enumerated(ACPI_COMPANION(&client->dev)); device_remove_software_node(&client->dev); diff --git a/drivers/i2c/i2c-core-slave.c b/drivers/i2c/i2c-core-slave.c index faefe1dfa8e5..7ee6b992b835 100644 --- a/drivers/i2c/i2c-core-slave.c +++ b/drivers/i2c/i2c-core-slave.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "i2c-core.h" @@ -108,15 +109,18 @@ EXPORT_SYMBOL_GPL(i2c_slave_event); */ bool i2c_detect_slave_mode(struct device *dev) { - if (IS_BUILTIN(CONFIG_OF) && dev->of_node) { + struct fwnode_handle *fwnode = dev_fwnode(dev); + + if (is_of_node(fwnode)) { + struct fwnode_handle *child __free(fwnode_handle) = NULL; u32 reg; - for_each_child_of_node_scoped(dev->of_node, child) { - of_property_read_u32(child, "reg", ®); + fwnode_for_each_child_node(fwnode, child) { + fwnode_property_read_u32(child, "reg", ®); if (reg & I2C_OWN_SLAVE_ADDRESS) return true; } - } else if (IS_BUILTIN(CONFIG_ACPI) && ACPI_HANDLE(dev)) { + } else if (is_acpi_device_node(fwnode)) { dev_dbg(dev, "ACPI slave is not supported yet\n"); } return false; From patchwork Mon Apr 14 10:01:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 14050088 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 0CD132673A3; Mon, 14 Apr 2025 10:04:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625061; cv=none; b=DKQdcTzkA7gx0mOFaPL6/CJVtuG+W2ygp6qtKAalqOzR5Wb3OoHL1Ieaan4/Yi1Mn3d1Y8MZ4D87cJCRmkBXuOOhvfhK8V8+LlPAMlBpx03Au2bjApAfwhsLwahZ79JZ5XqwMFG2+YWMhfm8lhslp355UleT2IDXYx4hl57pPMo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625061; c=relaxed/simple; bh=5PFQYjaUnb3ZPXJCpgDL6Af4OLub5qhRthcMuDczcC4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fm4feHVh6JaWtUbIE2h2b737p5MkX8tzPQBzfvQtpD+HxuYNOkk+f+XDDrgyuIO2RLQQPeVPSNIQGOJ6/bzfHKIGgqIRy5X5mCwGsL7KT4XrPnvuC8rD++i/sDuXetEb1U+LiYky0hbQr/Xki3qC1bEQUidNfbWp4tWK7s0wRCw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=iBZQnRCd; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="iBZQnRCd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744625060; x=1776161060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5PFQYjaUnb3ZPXJCpgDL6Af4OLub5qhRthcMuDczcC4=; b=iBZQnRCd3CJfdxtZ6pP0Ksi0X3B9AN4A3RB3rN9TUKD8iLYJBwVnH+Jd TlvYGPsdXn7qF82pz/OiwMG+OQh8tQd8B5cLOGyReVHLwImWxDW3pv6kF ECRk/uiXqlbyVk9YLVIXh51K+dBMLWX7K2U0e/HgrG1Ty5soGTIEFePck mCQsQDaxjEM2dV4GP5F7agr1+X641WOIDkNdMrZsAjVCAiKQLEsviHr+V rb3QF2pI5frI3yODuYZ55Y/PMF4O/6zMPcbyczq6PYb1DdQIGvD8aeXaP 5dO2JpeGLWfe3PQOPR12XDN3huX93Sxt4Ild5Y3RFnErxJyFGSSigMNId w==; X-CSE-ConnectionGUID: 4n2AaKJPRly6hYA2ULvrvQ== X-CSE-MsgGUID: 87stsSEhS1itpEKZPKU/Ng== X-IronPort-AV: E=McAfee;i="6700,10204,11402"; a="56747117" X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="56747117" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2025 03:04:16 -0700 X-CSE-ConnectionGUID: DelqBiD6RjWU8Mo/iJTaew== X-CSE-MsgGUID: 0QDMolCpSeKqBEc9MZnVvQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="134747319" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 14 Apr 2025 03:04:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E0C28A90; Mon, 14 Apr 2025 13:04:11 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Mauro Carvalho Chehab , Tomi Valkeinen , Jai Luthra , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab Subject: [PATCH v4 3/7] i2c: core: Switch to fwnode APIs to get IRQ Date: Mon, 14 Apr 2025 13:01:53 +0300 Message-ID: <20250414100409.3910312-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> References: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Switch to fwnode APIs to get IRQ. In particular this enables a support of the separate wakeup IRQ. The rest is converted just for the sake of consistency and fwnode reuse. Tested-by: Tomi Valkeinen Reviewed-by: Sakari Ailus Acked-by: Sakari Ailus Signed-off-by: Andy Shevchenko --- drivers/i2c/i2c-core-base.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index edab56e5d5e5..04985abe0e5d 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -26,14 +26,13 @@ #include #include #include -#include +#include #include #include #include #include #include #include -#include #include #include #include @@ -510,9 +509,9 @@ static int i2c_device_probe(struct device *dev) pm_runtime_get_sync(&client->adapter->dev); irq = i2c_smbus_host_notify_to_irq(client); } else if (is_of_node(fwnode)) { - irq = of_irq_get_byname(dev->of_node, "irq"); + irq = fwnode_irq_get_byname(fwnode, "irq"); if (irq == -EINVAL || irq == -ENODATA) - irq = of_irq_get(dev->of_node, 0); + irq = fwnode_irq_get(fwnode, 0); } else if (is_acpi_device_node(fwnode)) { bool wake_capable; @@ -547,7 +546,7 @@ static int i2c_device_probe(struct device *dev) if (client->flags & I2C_CLIENT_WAKE) { int wakeirq; - wakeirq = of_irq_get_byname(dev->of_node, "wakeup"); + wakeirq = fwnode_irq_get_byname(fwnode, "wakeup"); if (wakeirq == -EPROBE_DEFER) { status = wakeirq; goto put_sync_adapter; From patchwork Mon Apr 14 10:01:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 14050089 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 0F3FC2673A6; Mon, 14 Apr 2025 10:04:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625061; cv=none; b=l4E/4NTdrAIAEBLOssEV3iaOLhOSOCFQMSkNzVjnl3d6lF9fRK+wE9AMJtI7sSMidWM4sePLRuk21tT55ID/0hHpDwWTnhUO4ZYXcjCXZfhtZh/sbfJj+jqnhH5y0Zc13aEJzRnHvPhURF1C0/DXv+jC/a8IQC5GQJ88ga5NSLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625061; c=relaxed/simple; bh=jl66AMgy5B656FFMXcI3o9RT1swQVY7zVyfhfqfCPB4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hEqnMatkCLj/DdBhIClD9JOZObWIYt9SwYnBP5UeMTyQHzD9uOu8Hai5NbR+KnNTMLEBkwi/7Mzy0iGLM/eyOiTeJolieIQYy+SQcZe1hqlC8DlsFWJ87LLy0FPf/PuaGFk37IwgIB+T8sJFXIYQw7amk/r2nP400ooA99whM5E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KKqL9F04; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KKqL9F04" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744625060; x=1776161060; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jl66AMgy5B656FFMXcI3o9RT1swQVY7zVyfhfqfCPB4=; b=KKqL9F04VdIzgERlWdvOE6sjuG8E4XCkYHHmIcfLzCMf1LZ7WKkD8aX8 Z10JDu2JH/OEk7gtzFWO2Ig5Jqzi2KqzDpL5TvUZOA+kg9tg/58/hIniD 1pxYyCa8bEKOMcN2cMkdngqahpe5YUhdVFnAklwXBW6E9iL4Y0tr5S/+Z W6l4xeBM1G1LT0Ws0Rg9KXuMpFzn3ob5Js6rviHq8Ijfe+yTZ/lSX+dxl fMTrhwl+Z8+VcJk6uqY5HatF5ERm2qCTLN1CR6HG3JG7lb5oZ9/IjYLcO DsH/WNKhKL+qn0j5/3m03ed8UsUzjI/jgzKFCP4gU3ipgjXX5d1n/du3g A==; X-CSE-ConnectionGUID: HYtPufw9RE+q/KxrWAF+JA== X-CSE-MsgGUID: /EJMirQBTdy1Zdw/Csb1EQ== X-IronPort-AV: E=McAfee;i="6700,10204,11402"; a="56747122" X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="56747122" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2025 03:04:16 -0700 X-CSE-ConnectionGUID: WhnZ8idATl2j8to66/oDbA== X-CSE-MsgGUID: y41loHTKT/6co87Z/nMIUA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="134747320" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 14 Apr 2025 03:04:13 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id F129AAD4; Mon, 14 Apr 2025 13:04:11 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Mauro Carvalho Chehab , Tomi Valkeinen , Jai Luthra , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab Subject: [PATCH v4 4/7] i2c: core: Reuse fwnode variable where it makes sense Date: Mon, 14 Apr 2025 13:01:54 +0300 Message-ID: <20250414100409.3910312-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> References: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reuse fwnode variable where it makes sense. This avoids unneeded duplication hidden in some macros and unifies the code for different types of fwnode. Tested-by: Tomi Valkeinen Reviewed-by: Sakari Ailus Acked-by: Sakari Ailus Signed-off-by: Andy Shevchenko --- drivers/i2c/i2c-core-base.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 04985abe0e5d..9ca1ade043ed 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -567,7 +567,7 @@ static int i2c_device_probe(struct device *dev) dev_dbg(dev, "probe\n"); - status = of_clk_set_defaults(dev->of_node, false); + status = of_clk_set_defaults(to_of_node(fwnode), false); if (status < 0) goto err_clear_wakeup_irq; @@ -1061,10 +1061,10 @@ void i2c_unregister_device(struct i2c_client *client) fwnode = dev_fwnode(&client->dev); if (is_of_node(fwnode)) { - of_node_clear_flag(client->dev.of_node, OF_POPULATED); + of_node_clear_flag(to_of_node(fwnode), OF_POPULATED); of_node_put(client->dev.of_node); } else if (is_acpi_device_node(fwnode)) - acpi_device_clear_enumerated(ACPI_COMPANION(&client->dev)); + acpi_device_clear_enumerated(to_acpi_device_node(fwnode)); device_remove_software_node(&client->dev); device_unregister(&client->dev); From patchwork Mon Apr 14 10:01:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 14050092 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 BB29E267F7F; Mon, 14 Apr 2025 10:04:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625063; cv=none; b=hx5jL6W+3qDv2THZjU29YxKBZoDsZOre0T6wBrEcTMqZfxlQDr+3uqYfxnYXTTgPhKjahTmpIXF12RDrbE7+40Y5JkTgFCEmH8vITMa55KzVDJpOH4et/i9JvezUZUilbbQoQtX/PHexg60lDvorS8AHnzcRksvRkem1l3bNU6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625063; c=relaxed/simple; bh=bd4KAj3sdChvsK2ffRzybcufhcAUos8+tbD1pYSMCgY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JjL/k1NI9Fe/bfBxdXOp3QbvMkCe7gZ5747R4623GlDZFQ34d02yl46RIOqurjeJnHbsQCiiBghV8I4buuXSgk8oj4f16JvUdBp/7g78YcLsL66z2sfgdHi+vOIr0epSjigX6yLgY+4VYiss7fY/Wvnvzy7MHLXEpuMFdh/Ivdc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Oz9Qq0xu; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Oz9Qq0xu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744625062; x=1776161062; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bd4KAj3sdChvsK2ffRzybcufhcAUos8+tbD1pYSMCgY=; b=Oz9Qq0xuymQ7GTrSD4rJOqWHI28GQ1u9lkeiXfBSOOTg7/h0FkSATmII 3g3Fxe04ixa/hxpJSGw16SdZy/dApWOqRMCCxqG0nXUgjexWb0Pgu07Lj tXEBzWlXJzPIBBXq164YJ9bkVeiRhEJTPx4khABDBvvHWLfueJEvRio2b ujKbaInc9eMuEUdrA5ydX3J61XxhUKNDLCQVApjilVELRHuER7nOu2Omr kNC1C/ig+yAw7eJnw+Qh73AxuHXSnbbzZn11pehN53kOy+4b8X54ST5DV 1Kc5G7jg2fh/tvBT0kpwW1QRPmVA422RgNGweKsn1GNCEBYZXzdkSyVrC w==; X-CSE-ConnectionGUID: MfHGMLCjTBmIFnzeovTHZg== X-CSE-MsgGUID: cgedOvycQUC/HyuM82EoYg== X-IronPort-AV: E=McAfee;i="6700,10204,11402"; a="56747135" X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="56747135" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2025 03:04:19 -0700 X-CSE-ConnectionGUID: lWAQZE7wSJOgxe+U1HI3ZA== X-CSE-MsgGUID: dE8JzJi0S6u+DENQ/kymgQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="134747331" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 14 Apr 2025 03:04:16 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0AD29AF1; Mon, 14 Apr 2025 13:04:12 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Mauro Carvalho Chehab , Tomi Valkeinen , Jai Luthra , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab Subject: [PATCH v4 5/7] i2c: core: Do not dereference fwnode in struct device Date: Mon, 14 Apr 2025 13:01:55 +0300 Message-ID: <20250414100409.3910312-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> References: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In order to make the underneath API easier to change in the future, prevent users from dereferencing fwnode from struct device. Instead, use the specific device_set_node() API for that. Tested-by: Tomi Valkeinen Reviewed-by: Sakari Ailus Acked-by: Sakari Ailus Signed-off-by: Andy Shevchenko --- drivers/i2c/i2c-core-base.c | 18 ++++++++++-------- drivers/i2c/i2c-core-of.c | 1 - 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 9ca1ade043ed..dc3c60a7d382 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -961,6 +961,7 @@ static void i2c_unlock_addr(struct i2c_adapter *adap, unsigned short addr, struct i2c_client * i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *info) { + struct fwnode_handle *fwnode; struct i2c_client *client; bool need_put = false; int status; @@ -1001,18 +1002,19 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf client->dev.parent = &client->adapter->dev; client->dev.bus = &i2c_bus_type; client->dev.type = &i2c_client_type; - client->dev.of_node = of_node_get(info->of_node); - client->dev.fwnode = info->fwnode; device_enable_async_suspend(&client->dev); + fwnode = info->fwnode ?: of_fwnode_handle(info->of_node); + device_set_node(&client->dev, fwnode_handle_get(fwnode)); + if (info->swnode) { status = device_add_software_node(&client->dev, info->swnode); if (status) { dev_err(&adap->dev, "Failed to add software node to client %s: %d\n", client->name, status); - goto out_err_put_of_node; + goto out_err_put_fwnode; } } @@ -1031,8 +1033,8 @@ i2c_new_client_device(struct i2c_adapter *adap, struct i2c_board_info const *inf out_remove_swnode: device_remove_software_node(&client->dev); need_put = true; -out_err_put_of_node: - of_node_put(info->of_node); +out_err_put_fwnode: + fwnode_handle_put(fwnode); out_err: dev_err(&adap->dev, "Failed to register i2c client %s at 0x%02x (%d)\n", @@ -1060,11 +1062,11 @@ void i2c_unregister_device(struct i2c_client *client) return; fwnode = dev_fwnode(&client->dev); - if (is_of_node(fwnode)) { + if (is_of_node(fwnode)) of_node_clear_flag(to_of_node(fwnode), OF_POPULATED); - of_node_put(client->dev.of_node); - } else if (is_acpi_device_node(fwnode)) + else if (is_acpi_device_node(fwnode)) acpi_device_clear_enumerated(to_acpi_device_node(fwnode)); + fwnode_handle_put(fwnode); device_remove_software_node(&client->dev); device_unregister(&client->dev); diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c index 02feee6c9ba9..eb7fb202355f 100644 --- a/drivers/i2c/i2c-core-of.c +++ b/drivers/i2c/i2c-core-of.c @@ -49,7 +49,6 @@ int of_i2c_get_board_info(struct device *dev, struct device_node *node, } info->addr = addr; - info->of_node = node; info->fwnode = of_fwnode_handle(node); if (of_property_read_bool(node, "host-notify")) From patchwork Mon Apr 14 10:01:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 14050093 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 3A1E8268FEB; Mon, 14 Apr 2025 10:04:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625063; cv=none; b=Al93xOobnFoM50YtAj+53kseoybGryBNEIW1bwWYUpabjZvwXNKQja2jLPcvNOyUnnaVuLF1Fj9yF4JRVSIdSyAtOuHfLk89JyxOxeYQi926GZuUjl9aP7UFNoE+YMkgFi7vNcehRfejc9S4ouoWwon1bc3VnyOM/3u7l8aWCqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625063; c=relaxed/simple; bh=9vMgAE98MYpRnIk0gMgMO6YcMvJ1BWiMDswo9m1ORFw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FDOGKZsINcINThL6vY7d8AOQuc1ExlF23sMeKhYsl/MkOOjSUZ0iKOd1Hsi7Fv78zN2col2hdwNvmstbbGT9r9l1LuoL12UWK0LAbdV3YgHdaPVMlvheHjqT0gb2g8RLeYtu3/+by44pS58LWM5tnyKYCGtaTQLz/GKyOTAaQvk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Ey7jBXhR; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ey7jBXhR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744625062; x=1776161062; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9vMgAE98MYpRnIk0gMgMO6YcMvJ1BWiMDswo9m1ORFw=; b=Ey7jBXhROcxCOL2twLR9HrCikJSl6zAvf3zpeu8CjwHup5lQcXLrpmLc 7buyjpDY/Rf57D/EFfsiBR0LHtAay0nfEszRcb3SXMbOx7ZNl/iYY9qNn XWpEPyDiIwbBKu4gCHUC5CZOk0Uz33O9MUsF/RiIY5KXFqG8eH6E4MzQA mUEWs6zSxFAvzWspfNxe9+wI5nGu4VT+upV/8RrUcD/Fp+pB8PNxNzWC/ gtnvryQdlR+N+00532VVVJmNON+4AHjuQ2vEywMp8Sdw0Zd8BGRI5LTqB ZM8cdRiRPGIvtUMUIfX1sTw0LAMeMlGAfpNpLgJcZmw3wyDMk1uhFmytb A==; X-CSE-ConnectionGUID: vlY67s++RG+cGZvXGXopzg== X-CSE-MsgGUID: xU9tYnfWTtO/dBr+Lr09cw== X-IronPort-AV: E=McAfee;i="6700,10204,11402"; a="56747141" X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="56747141" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2025 03:04:19 -0700 X-CSE-ConnectionGUID: 3S7uPp+oRnix1ZMQDCtjdg== X-CSE-MsgGUID: 265FqWCZTi+vIEs2TedQKw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="134747329" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 14 Apr 2025 03:04:16 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1AD21B0A; Mon, 14 Apr 2025 13:04:12 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Mauro Carvalho Chehab , Tomi Valkeinen , Jai Luthra , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab Subject: [PATCH v4 6/7] i2c: core: Deprecate of_node in struct i2c_board_info Date: Mon, 14 Apr 2025 13:01:56 +0300 Message-ID: <20250414100409.3910312-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> References: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Two members of the same or quite similar semantics is quite confusing to begin with. Moreover, fwnode covers all possible firmware descriptions that Linux kernel supports. Deprecate of_node in struct i2c_board_info, so users will be warned and in the future remove it completely. Tested-by: Tomi Valkeinen Reviewed-by: Sakari Ailus Acked-by: Sakari Ailus Signed-off-by: Andy Shevchenko --- include/linux/i2c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 2e4903b7f7bc..cc1437f29823 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -405,7 +405,7 @@ static inline bool i2c_detect_slave_mode(struct device *dev) { return false; } * @addr: stored in i2c_client.addr * @dev_name: Overrides the default - dev_name if set * @platform_data: stored in i2c_client.dev.platform_data - * @of_node: pointer to OpenFirmware device node + * @of_node: **DEPRECATED** - use @fwnode for this * @fwnode: device node supplied by the platform firmware * @swnode: software node for the device * @resources: resources associated with the device From patchwork Mon Apr 14 10:01:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 14050094 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 9884926563C; Mon, 14 Apr 2025 10:04:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625065; cv=none; b=sHEIcp3jQaCyc+G5UnQo4yOdCNJf+WeX2Sz7Hanm9D1LwdUc1DnqWIHrlBzMUe4Ujc/IroSbMJaaH6F44a4Vy+r3JLrKIfValIg2h0XGuMF2ZEyXn0kYsOuEpP+KgCpF/ESN5Vj8+Dw9OOktmr8A2iyxqJWlGoPOO+wrw2ubVYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744625065; c=relaxed/simple; bh=/z8O9SDZiaTEXhg4ysbJsJfwrcHDw53/UnAOR7/dwrs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tZrz4yJZ4iRY4/uDOQUUlQiRcu7FQxyN2GvTNEi5W1EP2RUhW0eI3BCmFIJkJ7FGPQ3clmHKY9LOqpKMeCsXVHJQC4OA/RRI3DHenlJbrn8fNkYs+kp4i8U3Y8vX2fN8D4u7/4Y+hPml7aCmylnuOiM6EYeWMsp4iDb2w+Xu36E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Q6ovOH7P; arc=none smtp.client-ip=192.198.163.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Q6ovOH7P" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744625064; x=1776161064; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/z8O9SDZiaTEXhg4ysbJsJfwrcHDw53/UnAOR7/dwrs=; b=Q6ovOH7PJfHtfnPtdN6kdJz7+FDvv1+hNvioIkyKQ7JHB5Zu51GLXsiM Z89bnPLrMDr3nv0I1hFJF1qEQNkyTX41vpwq7rLOVLjOQJypHDVYg704w X7/wDScJ8oT0dYcJ+MXBq6g/YR5MXE2xU8S6QEjtusX4vyH9EU76SGWIp UUWx42NsF6VQ9RFnaT595eBijUHsC6MujOPWXimy9D/FQMwxC33Q44BKq xGvlhQKfSEizA9gR4EL0af87NI2UbSUb4bn7szd2LY2t6p7Xx2qeVfOVi rmD6S/uPImF408Df63yfo1LBLEoyIU/kk4LImtg03qzTdz1LXPkHxy3RQ A==; X-CSE-ConnectionGUID: 66BRT2IBQ2W8gfQOLYXjDA== X-CSE-MsgGUID: wL5gpYmjSaKRs7DOGKulmQ== X-IronPort-AV: E=McAfee;i="6700,10204,11402"; a="56747145" X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="56747145" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2025 03:04:20 -0700 X-CSE-ConnectionGUID: VpzGRA15T4Gp+B8WZerERA== X-CSE-MsgGUID: 7/ZuEDTWRcaEL1Rsg354Fg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,212,1739865600"; d="scan'208";a="134747330" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa004.jf.intel.com with ESMTP; 14 Apr 2025 03:04:16 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 261CCB0C; Mon, 14 Apr 2025 13:04:12 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Mauro Carvalho Chehab , Tomi Valkeinen , Jai Luthra , Wolfram Sang , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab Subject: [PATCH v4 7/7] media: i2c: ds90ub960: Remove of_node assignment Date: Mon, 14 Apr 2025 13:01:57 +0300 Message-ID: <20250414100409.3910312-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> References: <20250414100409.3910312-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Remove of_node assignment which duplicates fwnode in struct i2c_board_info. In general drivers must not set both, it's quite confusing. The I²C core will consider fwnode with a priority and of_node is subject to remove from above mentioned data structure. Reviewed-by: Sakari Ailus Acked-by: Sakari Ailus Signed-off-by: Andy Shevchenko Tested-by: Tomi Valkeinen --- drivers/media/i2c/ds90ub960.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/i2c/ds90ub960.c b/drivers/media/i2c/ds90ub960.c index 5dde8452739b..5afdbbad9ff4 100644 --- a/drivers/media/i2c/ds90ub960.c +++ b/drivers/media/i2c/ds90ub960.c @@ -1682,7 +1682,6 @@ static int ub960_rxport_add_serializer(struct ub960_data *priv, u8 nport) struct device *dev = &priv->client->dev; struct ds90ub9xx_platform_data *ser_pdata = &rxport->ser.pdata; struct i2c_board_info ser_info = { - .of_node = to_of_node(rxport->ser.fwnode), .fwnode = rxport->ser.fwnode, .platform_data = ser_pdata, };