From patchwork Wed Apr 16 07:01:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 881725 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 45472221572; Wed, 16 Apr 2025 07:04:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744787058; cv=none; b=Hj+has1qX8bNo32mfhiYhCb6jbM/pDQ/NLKEkQcT9xP/qQ1P+p7pA+3MvEm5YwdDGIOW/Bz0xmR1SmDpVVPAwh4+MrkGY48+cAEjtHH0netzwSrJV5yOT2GFRwCZ6EAnFvcoeN/Tyf8WaPE0J+FssVdLkTwbGoxOHCyyg7M9PVA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744787058; c=relaxed/simple; bh=ePHhqI9hu+n6tZEJhbHqhlZGeiDxvd33Qi45kz+hnIY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MA7G6xOsbUa99EWoswqKVUaUemErPBEoefR6oatSTIafocHrso3sH5GgwSqKz/+i7Q6IQzX9d5efDbvOAvipl6v4DPpBTpe2l0z++a7iTbgpoagXlx77xf6YWIanaUEclxVL0CnDU1cRtWTdhlSWUmkEuPvN5D151F8T1FyXcDw= 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=n+esTsqG; arc=none smtp.client-ip=198.175.65.21 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="n+esTsqG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744787056; x=1776323056; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ePHhqI9hu+n6tZEJhbHqhlZGeiDxvd33Qi45kz+hnIY=; b=n+esTsqG69Fd/M4MuDH9cO3PjLg3ZYH1X6URcfV1lG28YxkyYS43nZLX 29DAP6usOyIN5I1u0LBvKBUxvmukZnGwq8+5YN0ETwCdsK9JoXMCorzf/ xptLrBcQA+bUbP78Brc7BqVSoo1qZl+0wUwAqxuwsblGctwTkwQpJdOTq nkWsCc9fIiYtKNDRqnF13MeIbNNS4hme4VhS7CmAWCkTErIkipU9YBHs0 jxVGsab8vhaQtfa7X9p4y9JW5MpRzPoaBzm/8z+mr3cIa0297al/ryGQB hMHFJornCNU1jfeEyqfExjvSTCiWnlYDrhZUE+3zQ9A/Lb/1ko8GQf5pH w==; X-CSE-ConnectionGUID: UsVUvF5sQpCu0hrMgoUHkQ== X-CSE-MsgGUID: /u8czRG4Q/GMptLJjYQSgw== X-IronPort-AV: E=McAfee;i="6700,10204,11404"; a="46241840" X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="46241840" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2025 00:04:14 -0700 X-CSE-ConnectionGUID: tNsrczTeQ7yc8bzHiLZRfg== X-CSE-MsgGUID: uysz7O20Qgmt2PubSXD42w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="131315353" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 16 Apr 2025 00:04:12 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 75885E0; Wed, 16 Apr 2025 10:04:10 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Tomi Valkeinen , Mauro Carvalho Chehab , 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 v5 1/7] i2c: core: Drop duplicate check before calling OF APIs Date: Wed, 16 Apr 2025 10:01:31 +0300 Message-ID: <20250416070409.1867862-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250416070409.1867862-1-andriy.shevchenko@linux.intel.com> References: <20250416070409.1867862-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 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 Wed Apr 16 07:01:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 882735 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 E9F9315B546; Wed, 16 Apr 2025 07:04:15 +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=1744787057; cv=none; b=T2NxUYd76jHlkOV+GAxJLnZIO4KS1TnnYt2rbqE4BZgmMwfEGuRc7/ASeCJmBSVFvs+/lW+PxiaNr8T0AKNSe5RZnofqJzbi5PBnV2sZYeYje5McpO82z186mIcLmspjtZx7sF9xsdjINCLXDpPGAv+c3YVzDWS5maQjGAaqpjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744787057; c=relaxed/simple; bh=uVXZ/I4BjJPmGivqzDxmoi0h39+yTFROdzKZFZdSbkA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Di3+G047EWd43NiT2o1G8NovT3Y4uAAXgzxGsnvnKbg1ZGRyvLHbBl15i8VqG6RwHwtijbbyy4/yfKs0m2I4k2C2tn+VtPxYsiKqYotiFaxTFcwga+/olpKgICUuU8ls9VRetGC8W+DzK437eSb3yhebuQxybjkbWt3IVN/lYy8= 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=cvbSSuMF; 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="cvbSSuMF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744787056; x=1776323056; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uVXZ/I4BjJPmGivqzDxmoi0h39+yTFROdzKZFZdSbkA=; b=cvbSSuMFPkrm6eXQxGH49AAkYvblzzvVqBRJ9qawIlBZIqr9hYq18NjY Tlu0W47E1NsjiD0zkuq8yXTiZr6Z1ICwQuIAVXZpDBYU0wPI2rzWiCLTS gUDIDws4svq4RGAQeOyWcLEdT8zkvu991Hht3sIwOWuNB12JOIyJty3TF 4PFdkQn+5h+fQGD6V2i1t670iaEM/apTVX5rpOjGCcHOhwtWjRLjYEs+m XJphdcVe5wQGBal4gZGG91WCKr7tGS+EdhvTUVyIyJ+b0HwagExitZRrC ab5Eqx5xil5Sstat0Ex1TKJo2BJqk/WPnxeZmBEQ1Egd4fD71z764teM6 w==; X-CSE-ConnectionGUID: bYJvw4YRQTmgfR2wgKJ9Qg== X-CSE-MsgGUID: H4eYMbD7QomIgh5HhRhZxw== X-IronPort-AV: E=McAfee;i="6700,10204,11404"; a="56983831" X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="56983831" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2025 00:04:14 -0700 X-CSE-ConnectionGUID: CiycHQfTR1arOzJWf+kXZQ== X-CSE-MsgGUID: NibRE/CgQRONXlEtrrzM9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="130668501" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa008.fm.intel.com with ESMTP; 16 Apr 2025 00:04:11 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 83D0822A; Wed, 16 Apr 2025 10:04:10 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Tomi Valkeinen , Mauro Carvalho Chehab , 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 v5 2/7] i2c: core: Unify the firmware node type check Date: Wed, 16 Apr 2025 10:01:32 +0300 Message-ID: <20250416070409.1867862-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250416070409.1867862-1-andriy.shevchenko@linux.intel.com> References: <20250416070409.1867862-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 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 | 15 +++++++++------ drivers/i2c/i2c-core-slave.c | 12 ++++++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index c14ffd6190d3..2b5236b726af 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,16 +1055,18 @@ 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); device_unregister(&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 Wed Apr 16 07:01:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 882734 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 A71EF224888; Wed, 16 Apr 2025 07:04:17 +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=1744787059; cv=none; b=kKnZ/+C7YUtk6fKCVeT2jMiX1CaBa0yerDgREO741iJ+HEeQwvd84VYJCkVYYKAxLmWMygfMGisvVEoWiTwYqY5ZDlQsr7dAgog5iKlqFgZVZJxqXaz1DP7Q76N0hTzE4mIxbxfiq1+C3PWS+RNHPbQIHOVbS6uD5BCW27fHmlc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744787059; c=relaxed/simple; bh=eiPp1dIZglT6Llp+v5V3BzQhLD5quCsZRmYGDnypSEs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qIkiLB5Wd5nqU17LaHVNFmxQR/SJ4vcTQihFu68jrKb1wi5ckoZXcE7HeyvACB17fy5BK6kuTBqdGyiTy5ezw0IPOKEB/J8lI4eAo02zonkH/6bsAI18efVtjKffJYhc056qUhr7QKPUd2hv8iajearVz7mxEoL/porw940kNrU= 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=VEalu380; 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="VEalu380" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744787058; x=1776323058; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eiPp1dIZglT6Llp+v5V3BzQhLD5quCsZRmYGDnypSEs=; b=VEalu380TQF+rgJYX524ceAcBUZR3PVqoK1Hec1VeGOhqwgVWHRfBmPh bIY2r2loxXRqYEwbYmtBMnyGOChlqtqjzTLneEBkRCESXmLtQIjy3/pIo oSe6VEdFoJ6S+v+O1Sa8Kg+mfZU5LvTFmpzdIqLr3UeuHyz5AfYVQTGGR A2BJyZvckFbtFXFJFXKWHIne1d4hNKyAFXp4jpgDQTT6Ihld/iip7K6fw bMWogdtz4aMK4uOKNv/5LgP1OM4qhfZDZao2Xv2t//R13Vp7t+8JDOJ3K yA9LCKxcxMZaBJcoaY/vdye9WAeaCXUJGdG/4iHAJ3rftrjLQVG0A3qEn Q==; X-CSE-ConnectionGUID: hHV5rwUOSLqRet/b++wVBw== X-CSE-MsgGUID: 9xUXIMoOSJW/ft/ff10/Rw== X-IronPort-AV: E=McAfee;i="6700,10204,11404"; a="56983838" X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="56983838" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2025 00:04:15 -0700 X-CSE-ConnectionGUID: 37aLm/MhSKCr+BnjpGVy4A== X-CSE-MsgGUID: Eqdlxy8ASjuPE9ZaorRACw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="130668502" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa008.fm.intel.com with ESMTP; 16 Apr 2025 00:04:11 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 937BE481; Wed, 16 Apr 2025 10:04:10 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Tomi Valkeinen , Mauro Carvalho Chehab , 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 v5 3/7] i2c: core: Switch to fwnode APIs to get IRQ Date: Wed, 16 Apr 2025 10:01:33 +0300 Message-ID: <20250416070409.1867862-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250416070409.1867862-1-andriy.shevchenko@linux.intel.com> References: <20250416070409.1867862-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 Switch to fwnode APIs to get IRQ. In particular this enables a support of the separate wakeup IRQ on non-OF platforms. 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 2b5236b726af..08ff3f1eb28e 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 Wed Apr 16 07:01:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 882733 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 D2DFF22D4D9; Wed, 16 Apr 2025 07:04:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744787060; cv=none; b=AXTJKnEx8sKz7asZaBAe1DagePFCfAksrabbg6aFSelKq4xW9ba2a2CokfYf7FRyvSD/uCwiFZ7q+53yTfP6xx3yjU6tZuVkcpubfKCwUdiq5Y7qy2oi4ZIRg/HVxJmfyXUmO33YPJ/kEQ8NhDPt9jmqAgNyTrslMImXj4ecDSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744787060; c=relaxed/simple; bh=2jpVZLcIGatM7QYsGa2u0dgdWMPJK8+JBwiqyHj7KFA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nm+pMPAEHfKyYWPpAeXiki+JvgtXm5olFk6IWhHJ2TfCwEfiIXKJ74BFIuCLJRcZStIO5acRfZSZvxs4N08HDuTu3WEG/FbdbuDn/yBQ/VHCb3k9DYoaD3GFqnRZJ8X2cbrdqbZyhuilWzqxEYOGaTZ/+Hw/DSkW54YqsPUovTE= 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=Qj3Uvwpq; arc=none smtp.client-ip=198.175.65.21 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="Qj3Uvwpq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744787059; x=1776323059; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2jpVZLcIGatM7QYsGa2u0dgdWMPJK8+JBwiqyHj7KFA=; b=Qj3UvwpqsQW0/1bgoQl6wGORr4fWZkiS24pZ5ltHRIO/Luw5H5E+N+aK JI7cM788lMGAgrXK9vpoBFXEtl8A055ateTNpyWBt9lyhIzGX5zvSRRmV pgjeW8w9lQqvY3eTJaQvdOGsRSSYhwEs05CkH1lxiSZMfyL30qsv34muV ous+49raYmIiOw/djgXcbFRuuK0Ey5mmvDQ70LfoGThhFeEjfzMyUWjaT 07DYWZjnaDG1qUt9XsqrCn5LYkjf9QNHygxYbxtlSxsJa4zrMPuGiwWLN JOVojIz2nq/0mHdrxThzDWmmcyfhkgFXakc8SuSD7vsmkjGDPU2LjS9/s w==; X-CSE-ConnectionGUID: 4PrA/whNRNOxK5R3o3UQVQ== X-CSE-MsgGUID: aIstOPLoTJ6Q6UAnSQ/oKA== X-IronPort-AV: E=McAfee;i="6700,10204,11404"; a="46241849" X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="46241849" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2025 00:04:15 -0700 X-CSE-ConnectionGUID: dms2+h3USQu87AuJqIkwVw== X-CSE-MsgGUID: bRw1tpL8SAWC84j8uT2mvg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="131315354" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 16 Apr 2025 00:04:12 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id A21AB5D9; Wed, 16 Apr 2025 10:04:10 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Tomi Valkeinen , Mauro Carvalho Chehab , 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 v5 4/7] i2c: core: Reuse fwnode variable where it makes sense Date: Wed, 16 Apr 2025 10:01:34 +0300 Message-ID: <20250416070409.1867862-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250416070409.1867862-1-andriy.shevchenko@linux.intel.com> References: <20250416070409.1867862-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 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 08ff3f1eb28e..b186de31a9ee 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); From patchwork Wed Apr 16 07:01:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 882732 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 EFB0115B546; Wed, 16 Apr 2025 07:04:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744787062; cv=none; b=UZe/CVK/26g2yQabhtgnV+JGDyp1v7Xrc3y6eboZsshZVxfzmK+TxwwTI+gU52Uml2NN8N5RrAERWnGdT6UC27CTIVTf+xPpXuKCOdeLnnQsIPW34hBdSros91PxiVKX1s2xlsESjyAj03nafQguNnjE59AWjaDOj9PzEsm3FHw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744787062; c=relaxed/simple; bh=anmEGGlbam++ED94HMau5JtlIwpkkWxloWnoJKhXLPs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=teA9H0UGn8yOqhXBafddG6j6eVc4HxJ2vdYhZAFtV+INDK/d7odfFX/A9g/oqo3OuvatSmXVZ3D9n2ir7GaOLqmNbodBytZLxlZyA+SVxr2EHY21Hf6hxT78OFb/CBXUmcvgFwil8NiuJRLKETb3JZHr7/H6ZUNB7FPWOjnY0I4= 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=B+0ek7Z8; arc=none smtp.client-ip=198.175.65.21 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="B+0ek7Z8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744787061; x=1776323061; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=anmEGGlbam++ED94HMau5JtlIwpkkWxloWnoJKhXLPs=; b=B+0ek7Z8uu8T0c6uaLPSbPC8Owv4GBD3GxyWgT431lxEAzgQ9940yp9o JlfBORE2qD+OptZV7ABrCZO6zRBtwbRyL9oZCcJ1PnxXZRJ4TpSJH7Gml SmGwEx9wS9Ij736N3lfQy+kgug3KdZQcJo3GNC5nG36NRHoHnQTB31wB4 IP3sNecV+sO2nIGk6KaUoAGJPsGcM4RmAI3QVCQu+kb8I3/ce+gnb8bEM /aKJ474/QKfvdpRR1lHD0Sc6JWS6cUooCU0cUNHgqeC6Kz5VfTwtrDCx4 8qpobLJoVXIHz2cthRViuQXYIiLYO+A+eJTiiy391VXE5FfqDEztdjjBm Q==; X-CSE-ConnectionGUID: POYBCcd9QSy9sf0jT7iU0g== X-CSE-MsgGUID: taUGxLqYT4CLICn2A+mW3Q== X-IronPort-AV: E=McAfee;i="6700,10204,11404"; a="46241857" X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="46241857" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2025 00:04:18 -0700 X-CSE-ConnectionGUID: gmsZ3NmJTrqPuq+wU16Ifw== X-CSE-MsgGUID: tGASitafQdWZKGJVCP8CPw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="131315371" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 16 Apr 2025 00:04:15 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id B166C6D8; Wed, 16 Apr 2025 10:04:10 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Tomi Valkeinen , Mauro Carvalho Chehab , 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 v5 5/7] i2c: core: Do not dereference fwnode in struct device Date: Wed, 16 Apr 2025 10:01:35 +0300 Message-ID: <20250416070409.1867862-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250416070409.1867862-1-andriy.shevchenko@linux.intel.com> References: <20250416070409.1867862-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 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 | 19 ++++++++++--------- drivers/i2c/i2c-core-of.c | 1 - 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index b186de31a9ee..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,12 +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 Wed Apr 16 07:01:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 881724 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 1105022A807; Wed, 16 Apr 2025 07:04:17 +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=1744787059; cv=none; b=kWApiEuyYPyRC7LM2LB1JYVvXPBEOABorsuAOL8fOW/paMypviKlXFBzJC5QWImLM69trCLUkUVbjnBPxQafZXo0I5rZpwubk32FK9BEC1ZbZpIAebi5x39uzeHEgsl0PnqmHrahs/eG05eTyNZubbkEF1dS2Gc0FqLM8/+Iy98= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744787059; c=relaxed/simple; bh=TqyrK1fGaIL9Q5ygZqfrynGB8QeJRvXJh2Uecp9dXIs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PxBSycRtqkhw7m6F5xyYxMIsoVYG7JZKsE1X3SSrdT1jG2vzLLsNSAPMre3V9YQepxcSyxem5c/aG9IJ+7G43027ej8DoO0NUkidnSllmMbqY+xcwpye6GeR6G5+m2Vt2bL+PTSuhiJkJsd6CPj1wT3p8oq8ImudNhmF0L/aK+0= 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=G+8rAt9u; 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="G+8rAt9u" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744787058; x=1776323058; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TqyrK1fGaIL9Q5ygZqfrynGB8QeJRvXJh2Uecp9dXIs=; b=G+8rAt9uci99UpJkS7/qkn3m+uXlXsjiN0pVEqUOLxN958xKKIM1ngHG WRKoGcIKjxStfGARVQ/R7QMVc9zYhVYWTrttpGT7jyCQPM3wEVIjBlZ7k c4iXTllruP+Wb6jm0jME8vVB2VctFY3H+/G37BcRy8GBUtg3m+PYVQfJb QGoT4NVdLNS2QBuKMMmy5FlDXWc6aytdPyBKxa4PKwMofpDkeedjnAKgt Enz7l4gnFXSMphol4T2MocI31vh2wcf34qezUcV3zHS7CyPwjZTCMwHmc HbR+cLhpudVttB8LGxc3s8fImZ/eQhntzKQ2x73mV4b3PDGy8c743XBrL Q==; X-CSE-ConnectionGUID: jj5FxL9oR4Crlvm8hbadyA== X-CSE-MsgGUID: OGFDNSpZTj+OW6FpzCWNLg== X-IronPort-AV: E=McAfee;i="6700,10204,11404"; a="56983843" X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="56983843" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2025 00:04:17 -0700 X-CSE-ConnectionGUID: zEA2I4E1RBSOSqVvVj2Txw== X-CSE-MsgGUID: xtSJB2rSS7ep1m0ZUTF0mA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="130668507" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa008.fm.intel.com with ESMTP; 16 Apr 2025 00:04:15 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id BCAC6741; Wed, 16 Apr 2025 10:04:10 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Tomi Valkeinen , Mauro Carvalho Chehab , 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 v5 6/7] i2c: core: Deprecate of_node in struct i2c_board_info Date: Wed, 16 Apr 2025 10:01:36 +0300 Message-ID: <20250416070409.1867862-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250416070409.1867862-1-andriy.shevchenko@linux.intel.com> References: <20250416070409.1867862-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 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 there is a plan to convert the users and 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 Wed Apr 16 07:01:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 881722 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 7613F2309B1; Wed, 16 Apr 2025 07:04:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744787063; cv=none; b=Uy0VLgv26V8hHcfBoWY93L2fLgQUYnicSSzrRr/czwo8qsIssAkKW6JwlCxzGy4QX57+5KF/bdULdeDbsvFtID7siy1kba0wM2T5wVXwJjzBDvuKJ7mX9P2KIgy5GB/xm+5Un1ba7PhfLFu0yju8P4za2Rf5bS8682mxU+eS604= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744787063; c=relaxed/simple; bh=/z8O9SDZiaTEXhg4ysbJsJfwrcHDw53/UnAOR7/dwrs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=grjbsSe6DteO0W/r/ZmuGB7gDOgUNk91cD7OHZosXIxKb1kwVH1zH2zghwuqH3b8q8sYHXmKEJRw0PVIw04keC12yfFetWSK4p4bzHtTMVZc4sY5z9dzbSUcUu6k2SjAXIOYbv/YbwoLECnvqphmJBrfItkvmb9wPEs0rDSlIfg= 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=IkpVsuLX; arc=none smtp.client-ip=198.175.65.21 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="IkpVsuLX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1744787062; x=1776323062; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/z8O9SDZiaTEXhg4ysbJsJfwrcHDw53/UnAOR7/dwrs=; b=IkpVsuLXfzqhZUA4wycQcJ3s8yDWk7hJuBkrm9nTLy8qjzc8toVRiSaR U51l42tRUve2tQDyOiN8HTZLqC47CcPH4VtejRryr63XK+qHFmmNriXNC 9TydHQ86qkRLWEKfTHu7YJLetpYEeuA2KUbRr3+DpnuH9qJIcxL3veZ75 MU80HyHd8pCwEONe36G3xEbiF0LmBnxcD4VNpjM4KbW7/z7nCmILY27iz nuoEhrxDCqEKF7Y92eVr4CuoYSev2mN6Mt2CgJdQ849++kXdwNZAwywHf WtHqvbEYtniKMe3FtUm4pk3u4j+2FRpmpIfjOO1cVx8+56AVIL9M6dMMC A==; X-CSE-ConnectionGUID: kPCNy67vRKa83ysMhHfYuA== X-CSE-MsgGUID: 2IcchoUgSyu6KLU+5Rbovw== X-IronPort-AV: E=McAfee;i="6700,10204,11404"; a="46241862" X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="46241862" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2025 00:04:18 -0700 X-CSE-ConnectionGUID: A1VrY2KOTjmLpK6I8Y5sBw== X-CSE-MsgGUID: 7BYbbExuR1STIQxM3SHw9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,215,1739865600"; d="scan'208";a="131315374" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa008.jf.intel.com with ESMTP; 16 Apr 2025 00:04:15 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C7B8476C; Wed, 16 Apr 2025 10:04:10 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Sakari Ailus , Tomi Valkeinen , Mauro Carvalho Chehab , 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 v5 7/7] media: i2c: ds90ub960: Remove of_node assignment Date: Wed, 16 Apr 2025 10:01:37 +0300 Message-ID: <20250416070409.1867862-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250416070409.1867862-1-andriy.shevchenko@linux.intel.com> References: <20250416070409.1867862-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 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, };