From nobody Mon Feb 9 10:34:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EF4A527A92E; Mon, 2 Feb 2026 20:37:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; cv=none; b=uBj3Gp/Gm6dpm8RfFRYDF8pDr8FpgCblyXUmyqCK3+4bEHc/xlJ/NQSxQi0ZUZMeVZi19Aj0VFvn1wWBzMIq1+GrLzRF2SVOkYS2VFyaeIwM5+YhjodLXM02llgRXjGxT47qOT5DXd+xx+VOgrUiOHqDR+YM7PLG672yAb2mhMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; c=relaxed/simple; bh=wzyK5C+7gEBOnnJZjSZxVGWBnuD0tO8LwZHYRLn2itQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=C+OzNdB61109AZ7+9GM3PVp/O6snZNPkJVKEy1p8pULPhPhw+Ln4DZiKVoqrPOTOqQKmgjknXg70ZHOcWDIXWCbhQoNvwFtV573Zteav4c8FYs29sDvO2PJ/wrhyWak8XzkDzTH+k7dl0zc+m0+tPRAZ0JDIyCuwGlRgCtu7m+w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c9PEh8nf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c9PEh8nf" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8BB0FC19421; Mon, 2 Feb 2026 20:37:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770064655; bh=wzyK5C+7gEBOnnJZjSZxVGWBnuD0tO8LwZHYRLn2itQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=c9PEh8nfTUL3RiuDS0YNU7hXUjr+nFNk/3xoRajlJqiyOOz8O1kVgUjnknSUYiO4F ThrN0CWKjjtms1KE9nBCBCSb2cOiiWyEBDqB8vPnNnE0EasUczSPmgQiBz/AD5qbeQ XylOT0PgspmCXrQIRjdZv7bB1K59OZQOV2Grl53Nd1VgVWtvMggDlsVGTLnGwPra9H HOhVrQY83rbCuox+B3G1Z2aCtHxcSO9pwCB6mfSicjOMzDCxK0V/j3pMXzyy9cG5Au d26b/7eTRqTIq0snR0MYGF2KykDedrMpcRHDRYjpVifW5xt8AodUA4MXdeLVbaZuHr SxMEUfvr3NA2w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F7D5E7FDD1; Mon, 2 Feb 2026 20:37:35 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 02 Feb 2026 20:37:18 +0000 Subject: [PATCH v9 1/7] i2c: xiic: switch to devres managed APIs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260202-i2c-xiic-v9-1-ce4695f5267d@nexthop.ai> References: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> In-Reply-To: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1770064654; l=2947; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=W8zDDZw4EUzfrNuEoTOo05XNo8J4+DIsLswOSdxs308=; b=o4Yvz0UHDtX4jQ/jQr+uic+MZtDr1LnHeePbTXWkcq+5ymZwx71i2Db1yzzemVp67Uy+myQAw TRCh5gm7pfiDRnb/nZjXVqNSHi6p3stflXbnTTNseoYdYcq07kHeBmQ X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Simplify the error code paths by switching to devres managed helper functions. Reviewed-by: Andy Shevchenko Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 28015d77599d..16ff83fe280b 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1423,6 +1423,7 @@ MODULE_DEVICE_TABLE(of, xiic_of_match); =20 static int xiic_i2c_probe(struct platform_device *pdev) { + struct device *dev =3D &pdev->dev; struct xiic_i2c *i2c; struct xiic_i2c_platform_data *pdata; const struct of_device_id *match; @@ -1461,7 +1462,10 @@ static int xiic_i2c_probe(struct platform_device *pd= ev) snprintf(i2c->adap.name, sizeof(i2c->adap.name), DRIVER_NAME " %s", pdev->name); =20 - mutex_init(&i2c->lock); + ret =3D devm_mutex_init(dev, &i2c->lock); + if (ret) + return ret; + spin_lock_init(&i2c->atomic_lock); =20 i2c->clk =3D devm_clk_get_enabled(&pdev->dev, NULL); @@ -1472,8 +1476,9 @@ static int xiic_i2c_probe(struct platform_device *pde= v) i2c->dev =3D &pdev->dev; pm_runtime_set_autosuspend_delay(i2c->dev, XIIC_PM_TIMEOUT); pm_runtime_use_autosuspend(i2c->dev); - pm_runtime_set_active(i2c->dev); - pm_runtime_enable(i2c->dev); + ret =3D devm_pm_runtime_set_active_enabled(dev); + if (ret) + return ret; =20 /* SCL frequency configuration */ i2c->input_clk =3D clk_get_rate(i2c->clk); @@ -1489,7 +1494,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) =20 if (ret < 0) { dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n"); - goto err_pm_disable; + return ret; } =20 i2c->singlemaster =3D @@ -1508,16 +1513,14 @@ static int xiic_i2c_probe(struct platform_device *p= dev) i2c->endianness =3D BIG; =20 ret =3D xiic_reinit(i2c); - if (ret < 0) { - dev_err_probe(&pdev->dev, ret, "Cannot xiic_reinit\n"); - goto err_pm_disable; - } + if (ret) + return dev_err_probe(dev, ret, "Cannot xiic_reinit\n"); =20 /* add i2c adapter to i2c tree */ ret =3D i2c_add_adapter(&i2c->adap); if (ret) { xiic_deinit(i2c); - goto err_pm_disable; + return ret; } =20 if (pdata) { @@ -1529,12 +1532,6 @@ static int xiic_i2c_probe(struct platform_device *pd= ev) dev_dbg(&pdev->dev, "mmio %08lx irq %d scl clock frequency %d\n", (unsigned long)res->start, irq, i2c->i2c_clk); =20 - return 0; - -err_pm_disable: - pm_runtime_disable(&pdev->dev); - pm_runtime_set_suspended(&pdev->dev); - return ret; } =20 @@ -1555,8 +1552,6 @@ static void xiic_i2c_remove(struct platform_device *p= dev) xiic_deinit(i2c); =20 pm_runtime_put_sync(i2c->dev); - pm_runtime_disable(&pdev->dev); - pm_runtime_set_suspended(&pdev->dev); pm_runtime_dont_use_autosuspend(&pdev->dev); } =20 --=20 2.52.0 From nobody Mon Feb 9 10:34:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 EF5A92D23B1; Mon, 2 Feb 2026 20:37:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; cv=none; b=sOFwZDfxenump7WLo/bmcNAD6Odc7C16YHCDPYMjBlhgxEKLEdR5QYPvdLG6J6G83b8PtL9mftHe0dG9ug+zZSe55K7doRLNQW4CQU4LLkrmG6XjZzMLmww4KlzwD2EDf0jrzm2HmnXd6gj8bsdp9rLsQZ/AwGXjrjc0L0FtJnI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; c=relaxed/simple; bh=9NOBASfi7anGmRe6t5aBWM/Ma9uXjL5J+KNCF/CduQY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vhno5LxkvOI4koVWzqIFljNALR6ywGdANl63hsdg+kH2LWVzrYQby5YKX5Nar5j966TrSG8NViMpcQ6xEjELnCv8onA9suQ6UDtaa8ml4ESadnf2rZyDsZN8CiGZKDchAZW/dbPY9qnyKt/USBn6gGg0Zb9Au+wA7Z+O89Au9p0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tsxScTUT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tsxScTUT" Received: by smtp.kernel.org (Postfix) with ESMTPS id A8DAFC2BC87; Mon, 2 Feb 2026 20:37:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770064655; bh=9NOBASfi7anGmRe6t5aBWM/Ma9uXjL5J+KNCF/CduQY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=tsxScTUTlOEAqZ97j2Hn2QFpHbZZJVMJRrdYYigEQrGrY2X9UtAU2LSG1Xna3KLun Y3+i8+zvmWmnQo/Nky7WELDgdc6hwBA8dACXUTSbiZTvUPWnSUtM4Mlxbi7ikIF/cy 4kagBUCRo4SWUvV57JADjJx4baKANxV8OygN+PuJ185toKFCrjIXVHs4plakUfS8Cg 07fwLYLOmR2bb3v3MNsVs1FkyaOUf0BZyHzXv8XWjmBun3IIPUp/tZciNU5RIWdV1s VWy9BBkKsInuJRTf0abGiAJ7nh0QtfYO13hRTPeshjzGtLHnlg5hqOYHc08zgjQ61N WyzGC3ia30Nvw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 993E2E7FDD3; Mon, 2 Feb 2026 20:37:35 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 02 Feb 2026 20:37:19 +0000 Subject: [PATCH v9 2/7] i2c: xiic: remove duplicate error message Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260202-i2c-xiic-v9-2-ce4695f5267d@nexthop.ai> References: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> In-Reply-To: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain , Andrew Lunn X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1770064654; l=958; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=KsvKdIRhjvHhQgBTA+p4IEJ0A4qmuGyZ80lYOv0Q75M=; b=EEY28N/1o9/YOJt+nW9+75JCikFRsOTVy+BfwG01Foue3FFJy82CDVuihkRN1WEcZEaHSXx1/ p6Ord3CnmnRDxfCiirRlP+RvS8Hof0sZ4sX9ikz746fJ1E7KGuMLCv+ X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain The devm_request_threaded_irq() already prints an error message. Remove the duplicate. Reviewed-by: Andy Shevchenko Reviewed-by: Andrew Lunn Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 16ff83fe280b..4cb7c40fb565 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1491,11 +1491,8 @@ static int xiic_i2c_probe(struct platform_device *pd= ev) ret =3D devm_request_threaded_irq(&pdev->dev, irq, NULL, xiic_process, IRQF_ONESHOT, pdev->name, i2c); - - if (ret < 0) { - dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n"); + if (ret) return ret; - } =20 i2c->singlemaster =3D of_property_read_bool(pdev->dev.of_node, "single-master"); --=20 2.52.0 From nobody Mon Feb 9 10:34:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2E910306B3E; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; cv=none; b=NfuiijrYLbZ05wIcPtLku1x/z1Aoh2+/1hNc9kn79sySWPbYdzzI8sodLzs18Hr4t+UWZTDxQsA/Z4FIJ9RWow64p4b1TmoUQQsOS4vdBKW9xfHr5frbOEPLuAIOhoN5AKoXraBLP5qR4/DGX0YdjMnah9ADOiUMfWMCwdp3Bh4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; c=relaxed/simple; bh=DPRlDntlu0iKeJf/CMopdHlJpBQ0BaeVB92s+jp4gPI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=t5PrCzWwDp0bfbSlAcJ69jucdff/jf/aUjmZU0SyEZH/4/r/D290nRY/gVdkgMqrvYM1BanFqmmjnTbuJBE6v7hzRrTZKr3f9KIXDdAxA3/OqFzzN4EBZTjLdvZNLSLFv7R02BidB5hRsBmpC7D66AUyII2FyjGpKvd4eMsoww0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WmFBf0A8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WmFBf0A8" Received: by smtp.kernel.org (Postfix) with ESMTPS id F184AC2BC86; Mon, 2 Feb 2026 20:37:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770064656; bh=DPRlDntlu0iKeJf/CMopdHlJpBQ0BaeVB92s+jp4gPI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=WmFBf0A8+WyIQh8CR08LMOJb6ODe925tph9qKHoSKRpMV+ZyvRxoz7g2kN4TC2H6b p6FzcBdD7EqvVZpSWhp5lsgSm+C55sQrYp545Bu4sZzAkL0Miqxw7e3l4OhfbDtkF2 pbSBrh3Rgf8HcxPhSXvQudtBUcUhqNOthlvkTQxrCld5f5Y4t23MOa/OXRmni9fQcV ts2MDbfMvUOTNqXDIZedLM7YFZTh2930boF52DYkxhsfbZmn6OF2Y3BWUWFhL0NrcM 9490bjH+JG+f0lBOocW9Fh1uwCu+lbwk0pdZ/NCA3icQKZ9u4r9PHRKqnBvr1kG0E5 gzHch2KSfa0Nw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E30DAE7FDD0; Mon, 2 Feb 2026 20:37:35 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 02 Feb 2026 20:37:20 +0000 Subject: [PATCH v9 3/7] i2c: xiic: switch to generic device property accessors Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260202-i2c-xiic-v9-3-ce4695f5267d@nexthop.ai> References: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> In-Reply-To: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1770064654; l=2990; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=k0KDwbzoPFBnih9Js9Y0osMzTW9DrweWovD0ZQMqow4=; b=hT4pIYna2kjLsAHgZEkq91lzyiUfBMTqWNz2EViDNnJP7gdkgiH7RVjrslfqj3JYoI+mV/5PP uO9oEJFOw28CkdhXBeBNTR1LAuLlzIRoLipl+gD+NNPuNI+xw4XMR8P X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Use generic device property accessors. Reviewed-by: Andy Shevchenko Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 4cb7c40fb565..60d417a2266e 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -1408,7 +1407,6 @@ static const struct i2c_adapter xiic_adapter =3D { .algo =3D &xiic_algorithm, }; =20 -#if defined(CONFIG_OF) static const struct xiic_version_data xiic_2_00 =3D { .quirks =3D DYNAMIC_MODE_READ_BROKEN_BIT, }; @@ -1419,14 +1417,13 @@ static const struct of_device_id xiic_of_match[] = =3D { {}, }; MODULE_DEVICE_TABLE(of, xiic_of_match); -#endif =20 static int xiic_i2c_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; struct xiic_i2c *i2c; struct xiic_i2c_platform_data *pdata; - const struct of_device_id *match; + const struct xiic_version_data *data; struct resource *res; int ret, irq; u8 i; @@ -1436,12 +1433,9 @@ static int xiic_i2c_probe(struct platform_device *pd= ev) if (!i2c) return -ENOMEM; =20 - match =3D of_match_node(xiic_of_match, pdev->dev.of_node); - if (match && match->data) { - const struct xiic_version_data *data =3D match->data; - + data =3D device_get_match_data(dev); + if (data) i2c->quirks =3D data->quirks; - } =20 i2c->base =3D devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(i2c->base)) @@ -1458,7 +1452,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) i2c->adap =3D xiic_adapter; i2c_set_adapdata(&i2c->adap, i2c); i2c->adap.dev.parent =3D &pdev->dev; - i2c->adap.dev.of_node =3D pdev->dev.of_node; + device_set_node(&i2c->adap.dev, dev_fwnode(dev)); snprintf(i2c->adap.name, sizeof(i2c->adap.name), DRIVER_NAME " %s", pdev->name); =20 @@ -1482,8 +1476,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) =20 /* SCL frequency configuration */ i2c->input_clk =3D clk_get_rate(i2c->clk); - ret =3D of_property_read_u32(pdev->dev.of_node, "clock-frequency", - &i2c->i2c_clk); + ret =3D device_property_read_u32(dev, "clock-frequency", &i2c->i2c_clk); /* If clock-frequency not specified in DT, do not configure in SW */ if (ret || i2c->i2c_clk > I2C_MAX_FAST_MODE_PLUS_FREQ) i2c->i2c_clk =3D 0; @@ -1494,8 +1487,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) if (ret) return ret; =20 - i2c->singlemaster =3D - of_property_read_bool(pdev->dev.of_node, "single-master"); + i2c->singlemaster =3D device_property_read_bool(dev, "single-master"); =20 /* * Detect endianness --=20 2.52.0 From nobody Mon Feb 9 10:34:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5B4AD309EFA; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; cv=none; b=q5H1G+4RMPgcD/3673pnIUx5Ij53FooSdZFfrH85NcvdS3mrFyL30zL0Pe3IJFKvlGizXFZYY5IUj4EKtD7FKEUWmVjZAaobQ+Obaw4fy32WY483YY/ozQyKBRBv617mq70lt94jYCvnheMfwpBAL6BGsafGwRofr7sDAxp+u2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; c=relaxed/simple; bh=xQU5PPxeDc+0ggIH9WZEoWwe2uu5YIUAtrcZwwYS7LQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UCK6rk8eImTsUI8fvrll0WJCFzEGgay49x2g3z2U/cidTTd8i/1BlxN/v0VKlnOCZEVydYJ3ZQ/pZXa5HVPa0iE4nlceuO4wEQ1OrGPgBrDQD5Lw9e8SY4S+oejxQ65Qh5QqP2hU9XUJ632qbaqf6xnZusa4HM/aRpHP6tuZdoQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KhTNy2YC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KhTNy2YC" Received: by smtp.kernel.org (Postfix) with ESMTPS id 29A9FC19425; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770064656; bh=xQU5PPxeDc+0ggIH9WZEoWwe2uu5YIUAtrcZwwYS7LQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=KhTNy2YCu2i158YI6OpQmMjegMnsyPHa1f01dlAIjjreL7sUSvWKxWiAXqlwbR+9L pWKtr+QF8a7DDI/i6vvE4pdjSlkiMiKYjM8LD7nNYf4ddpkSpZdcFOxdoSuRFYlsrd prCiIkqgSt+LNyGJ7mUXHYne0gyfY87ZD3YgVRRCo24fDvh42Enzb9H7skfU7UHXqq sAhNCFp/QYlgBu0pxEK99VIVCvVT08u7Z7uQC4fGdmSnUPIhvMxK3Lk3/rjst+jCb5 1zcNAfzEI2xAjKfIxKF5LTSUNSvsLJecbzTaYYmuEQRsapMzKm2wM2gPYhwHVXQ/OE ZmX5HpCvU0+kQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BD5FE7FDD1; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 02 Feb 2026 20:37:21 +0000 Subject: [PATCH v9 4/7] i2c: xiic: cosmetic cleanup Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260202-i2c-xiic-v9-4-ce4695f5267d@nexthop.ai> References: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> In-Reply-To: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1770064654; l=3409; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=0DWZjW9H3/UkwrFLsxBTXAgtbNv+3UJqeG68L2XODHs=; b=if+UC9iWfErVY6SaxHQIZCuqtCqMDtkdbrbVqk2dg5Gg3ZQUbwqPOGdQqj2BUiqWsZl8jw9J+ cYjeI5tEUk3CXsnEE1qODWt5TT6sTBCJ3/fBz2vJZiufgP/NtjNLxJM X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Re-use dev pointer instead of referencing &pdev->dev everywhere. Reviewed-by: Andy Shevchenko Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 60d417a2266e..ade0fd66451b 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1429,7 +1429,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) u8 i; u32 sr; =20 - i2c =3D devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL); + i2c =3D devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL); if (!i2c) return -ENOMEM; =20 @@ -1445,13 +1445,13 @@ static int xiic_i2c_probe(struct platform_device *p= dev) if (irq < 0) return irq; =20 - pdata =3D dev_get_platdata(&pdev->dev); + pdata =3D dev_get_platdata(dev); =20 /* hook up driver to tree */ platform_set_drvdata(pdev, i2c); i2c->adap =3D xiic_adapter; i2c_set_adapdata(&i2c->adap, i2c); - i2c->adap.dev.parent =3D &pdev->dev; + i2c->adap.dev.parent =3D dev; device_set_node(&i2c->adap.dev, dev_fwnode(dev)); snprintf(i2c->adap.name, sizeof(i2c->adap.name), DRIVER_NAME " %s", pdev->name); @@ -1467,9 +1467,10 @@ static int xiic_i2c_probe(struct platform_device *pd= ev) return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk), "failed to enable input clock.\n"); =20 - i2c->dev =3D &pdev->dev; - pm_runtime_set_autosuspend_delay(i2c->dev, XIIC_PM_TIMEOUT); - pm_runtime_use_autosuspend(i2c->dev); + i2c->dev =3D dev; + + pm_runtime_set_autosuspend_delay(dev, XIIC_PM_TIMEOUT); + pm_runtime_use_autosuspend(dev); ret =3D devm_pm_runtime_set_active_enabled(dev); if (ret) return ret; @@ -1481,9 +1482,8 @@ static int xiic_i2c_probe(struct platform_device *pde= v) if (ret || i2c->i2c_clk > I2C_MAX_FAST_MODE_PLUS_FREQ) i2c->i2c_clk =3D 0; =20 - ret =3D devm_request_threaded_irq(&pdev->dev, irq, NULL, - xiic_process, IRQF_ONESHOT, - pdev->name, i2c); + ret =3D devm_request_threaded_irq(dev, irq, NULL, xiic_process, + IRQF_ONESHOT, pdev->name, i2c); if (ret) return ret; =20 @@ -1518,7 +1518,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) i2c_new_client_device(&i2c->adap, pdata->devices + i); } =20 - dev_dbg(&pdev->dev, "mmio %08lx irq %d scl clock frequency %d\n", + dev_dbg(dev, "mmio %08lx irq %d scl clock frequency %d\n", (unsigned long)res->start, irq, i2c->i2c_clk); =20 return ret; @@ -1526,22 +1526,22 @@ static int xiic_i2c_probe(struct platform_device *p= dev) =20 static void xiic_i2c_remove(struct platform_device *pdev) { + struct device *dev =3D &pdev->dev; struct xiic_i2c *i2c =3D platform_get_drvdata(pdev); int ret; =20 /* remove adapter & data */ i2c_del_adapter(&i2c->adap); =20 - ret =3D pm_runtime_get_sync(i2c->dev); - + ret =3D pm_runtime_get_sync(dev); if (ret < 0) - dev_warn(&pdev->dev, "Failed to activate device for removal (%pe)\n", + dev_warn(dev, "Failed to activate device for removal (%pe)\n", ERR_PTR(ret)); else xiic_deinit(i2c); =20 - pm_runtime_put_sync(i2c->dev); - pm_runtime_dont_use_autosuspend(&pdev->dev); + pm_runtime_put_sync(dev); + pm_runtime_dont_use_autosuspend(dev); } =20 static const struct dev_pm_ops xiic_dev_pm_ops =3D { --=20 2.52.0 From nobody Mon Feb 9 10:34:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 A180930E842; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; cv=none; b=tkI2bbI/Ttzt0h05PIDJRuaWinnsknlaeDfIwWQ+fly1t2D8oV+DMoj0mB17dk61hYk1HeRZmpNbFVewm/B2QaNLqJYJgLtK8cSEwvqrMeudIGeNOibCI6f0STvnWE21tsNijEeyppgZCJSh1d4qjdIdRi2iODqtPLmOpI4yMpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; c=relaxed/simple; bh=Xksoe2+S7Mf+L+o1XLDCUHOeZtAgXsNJ8wt02v5c5fE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bZz3Micocyl9O9/yPM6R2hmec5kGoKt4MCQRmRyAQX0YOjAD9jZ5sbCgHJug9K9I2bUsrIfH5FrasmfGrdd/vyHtTNF5IVn2lXBgv2WaaOxSz2Jcmb9FWEzqxAl6vhsx7U960bemVAXddYq1nK9guo5xt9YOuNanD7BNnp8TxoQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uD2LGyb7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uD2LGyb7" Received: by smtp.kernel.org (Postfix) with ESMTPS id 56D55C2BCB1; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770064656; bh=Xksoe2+S7Mf+L+o1XLDCUHOeZtAgXsNJ8wt02v5c5fE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uD2LGyb79vtLQ27ZflKOdGS31cNVKV16K1yKZAqPGM0X7keSbvKWPlejyAYZbGMxd IrU1PQzTW5ybZO91p8VBqORtypSss0t1N9dpdKk+WKqQY/kD24hE/yTrv0Y7iAMqbx o5qF+EBMpov0ZYcJPlG97wga2oGS+vWDzFvX5WN7+6SGc1f0b8knsL6qJXhxc4w4Hw PpUatl0or53JPtRqA9LAHVgw2sjcdkQjoVCEPiLvaHeQ6iEQ9+O2LhfqBDYrdvx6yv LU32jWOcTQ5l7Mytuh9PGybtZ0ErxQMKyCvFebdOMiym2Tvfnzf1dD4O++x410biUl 091HTGHncwFng== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47768E7FDD4; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 02 Feb 2026 20:37:22 +0000 Subject: [PATCH v9 5/7] i2c: xiic: cosmetic: use resource format specifier in debug log Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260202-i2c-xiic-v9-5-ce4695f5267d@nexthop.ai> References: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> In-Reply-To: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1770064654; l=856; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=t2F391AQVy1CL9rMsRzI2NPAaYKBn3gbJ/BmjKyoXVM=; b=W3gV+F76fdQ6UqgI5HpUynyGfb5qvfIWV9fvKzLobDKxlBrKDdvI9S8L9/eeV50woSaJbJUYs qnRcBQYalwQAnRxJqrUci5kHgtCWUlFjDY67md93N50xL8ZdEltZZyp X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Use standard resource format specifier %pR in debug log. Reviewed-by: Andy Shevchenko Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index ade0fd66451b..eeb8ba8e131e 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1518,8 +1518,8 @@ static int xiic_i2c_probe(struct platform_device *pde= v) i2c_new_client_device(&i2c->adap, pdata->devices + i); } =20 - dev_dbg(dev, "mmio %08lx irq %d scl clock frequency %d\n", - (unsigned long)res->start, irq, i2c->i2c_clk); + dev_dbg(dev, "mmio %pR irq %d scl clock frequency %d\n", + res, irq, i2c->i2c_clk); =20 return ret; } --=20 2.52.0 From nobody Mon Feb 9 10:34:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B136630EF83; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; cv=none; b=Bc2zFWfAogsfXg6mdkXx+pUKF/Ka/RTc13oxRpu9564NPgF+6JiqU5N/MEOzULf54kwwCvczKenmx3dCnIfxUUTclNdqGXhyjI1+Fy2K739VnIlX3ys+tN//mkdNpE4bHeStdD+AtzhnIxnb9TReh9G7y18DmgQ4Qb/SqtJYXt8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; c=relaxed/simple; bh=EQnetrtHFK2rEBzsiSIHup8oVhTEzY0ph1INzOphpyk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qePDuy4JNsLk6/qjQygKxSNOl6dGuBvlcItb7mx7tA/2WRmErIDCIV/CbAVDo2c6T1i/P4/E+V2HMAtjUsICSegVNNVDLm+O/CF2z185RmNZFTn/RDCSQD+n2bK0AYxJ+8iDaeo97K+iY/ud21og5gMw7ZkNlxAdSgH6z6sGywk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mVs0lrsT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mVs0lrsT" Received: by smtp.kernel.org (Postfix) with ESMTPS id 7D10DC19425; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770064656; bh=EQnetrtHFK2rEBzsiSIHup8oVhTEzY0ph1INzOphpyk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=mVs0lrsT6Q8iv11/hUkqq8F6pK1qito6+AOxXu6XThaE+hX3IUVzmqFrFz5MlxpBe 58RBCk38RWthf7aDeq/tUgPjld8mTooLO3viTeIklH3GTgjZLygIqzm6xV4LharqCg O8C71UPsWbmoKkivbdTdjlDboJBVxnywBOJfD1Zl2zekvbEI4vfmA+/MPKxvhNabq3 7mi183bXvrdyp9wVNU1iZEJdSUFOfZAsqx9IbRlNU2ln3JuKYQw9mp4GXfMFSHgRJC bewWHGv7LOhbRCdWdhQOr/beiMoGOhpDTI6mfrDDWrc+R4OE4BBoAqASmxOvfGg1+p AoIhgHc7k1cGQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67E3CE7FDD3; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 02 Feb 2026 20:37:23 +0000 Subject: [PATCH v9 6/7] i2c: xiic: use numbered adapter registration Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260202-i2c-xiic-v9-6-ce4695f5267d@nexthop.ai> References: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> In-Reply-To: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1770064654; l=1108; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=RLQIf1A/Hfhfj6sGMEhyze1brD6x3yYtifNZ+L92dP4=; b=Pv2jgLeasoQVQ/mHZBmVLZKipUHNjCA59kwN3eQa9PgZN51zKu0N7s+U/mc0h0C5qL+qQZ+/7 AxI21/tBr1hBWozpraAV4N1nqfZ5knMK4UZ1RMS6mAqM7yaxWPfX/gz X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Use i2c_add_numbered_adapter() to allow platform devices to specify fixed bus numbers when needed. Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index eeb8ba8e131e..2c0470452221 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1450,6 +1450,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) /* hook up driver to tree */ platform_set_drvdata(pdev, i2c); i2c->adap =3D xiic_adapter; + i2c->adap.nr =3D pdev->id; i2c_set_adapdata(&i2c->adap, i2c); i2c->adap.dev.parent =3D dev; device_set_node(&i2c->adap.dev, dev_fwnode(dev)); @@ -1506,7 +1507,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) return dev_err_probe(dev, ret, "Cannot xiic_reinit\n"); =20 /* add i2c adapter to i2c tree */ - ret =3D i2c_add_adapter(&i2c->adap); + ret =3D i2c_add_numbered_adapter(&i2c->adap); if (ret) { xiic_deinit(i2c); return ret; --=20 2.52.0 From nobody Mon Feb 9 10:34:40 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 DE12730F7F2; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; cv=none; b=ZAn9waBjBBb+6iY8svGgVVrDNGSCOhuV3E16zJVdZ27GWXeUMDro+o88+K5cQ2gvWekpxaY/eBibLz4HHCy28I0xLgUbEUOvcLiAlacm5fpKIVlFCwHLxtOk9Hn7SGJeQ7jiRlUOdp3tBSTx/+5F0TP0XHH7ZwcYd3KA8HiKkXU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770064656; c=relaxed/simple; bh=aIxdhfft82t0LR/tguShdCXtDz/e/UoBlZbo+TcBruU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KaIxVOgfMdo/8Gn56Zfg3wGMwt20d4ZLT9Ix4bTlftv022VMthJ2VIu9MdL8UbMXS88x9qU5kzAY77cnGc/DIS3fKP16CKxeUqdSD1Nqcse6KzDP2fZpKPVNVUV9zY1Z1w7uXQbw2sf784J2GwDXHCrUHn9SipdqphblDTHQDrs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=St01odn+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="St01odn+" Received: by smtp.kernel.org (Postfix) with ESMTPS id B2BDDC2BCAF; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770064656; bh=aIxdhfft82t0LR/tguShdCXtDz/e/UoBlZbo+TcBruU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=St01odn+LFAwYbWH3LbiGNi3o+cLVov3o26fCA5sA8v4cpazmtzXRzF2f5zXyZz8I jGIHtxPKvFOJdddIJS5FH9uoXa2iw5lnFN7Qza1H0sB1jvh8EgqW+eIbszq3m+5mKd QyYdqMxo0ZDzOGki3qA5sovLiuf6oP61HUeLG/rPLoJOeSjoOSEc0lfqhsDmXyCcT1 qqiuxCF1xMl0dgBtMxCQfurkYL0kWwpUkaYBk4LN+UGN148r1dQZtKOPN8gNpv96+x JgvM4ooGiutEs22fVN3EofnHcMCAHQ79/7jpqvcz+xpchiLmBSV+zyoMpbiFgncwVJ 38EkKvhxWuVWg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D9C1E7FDD0; Mon, 2 Feb 2026 20:37:36 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 02 Feb 2026 20:37:24 +0000 Subject: [PATCH v9 7/7] i2c: xiic: skip input clock setup on non-OF systems Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260202-i2c-xiic-v9-7-ce4695f5267d@nexthop.ai> References: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> In-Reply-To: <20260202-i2c-xiic-v9-0-ce4695f5267d@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1770064654; l=1208; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=qAOgrbSGsxp0qSeRvLqeFzjiQ6yMVDZel5cRWAUzEco=; b=RvPUnGkIwT65/8Ukp0VGrxU1fvDeEccXellEgYK7PbZskP99R9ZlqKf/9m0bPPHIFsdSGi4uP AthFPKugAdRCbOREm48E4SZzQeeaoxdnyWVQUPfdPmUKm7w30zm8hkK X-Developer-Key: i=abdurrahman@nexthop.ai; a=ed25519; pk=S+ysnf+NwMcBdHBlyKIUEAtaFGSIhQwcJcgcXhq0osg= X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/20260119 with auth_id=608 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain Currently Linux does not implement ACPI ClockInput to describe clock resources, unlike DT. However the xiic driver is happy if something magically enables the clock before the driver probes, and does not turn it off again. The clock should always be considered optional for ACPI. Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 2c0470452221..017e33d4309c 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1463,10 +1463,12 @@ static int xiic_i2c_probe(struct platform_device *p= dev) =20 spin_lock_init(&i2c->atomic_lock); =20 - i2c->clk =3D devm_clk_get_enabled(&pdev->dev, NULL); - if (IS_ERR(i2c->clk)) - return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk), - "failed to enable input clock.\n"); + if (is_of_node(dev_fwnode(dev))) { + i2c->clk =3D devm_clk_get_enabled(dev, NULL); + if (IS_ERR(i2c->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk), + "failed to enable input clock.\n"); + } =20 i2c->dev =3D dev; =20 --=20 2.52.0