From nobody Mon Feb 9 04:45:41 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 647E6313291; Fri, 23 Jan 2026 08:03:05 +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=1769155385; cv=none; b=JXzqfVMuzvPFlFYXd7JiF9vm1PZKfMVSupDaK3VTjKTquFC9zbk/RWaYY5pCO89iH0ZrNQUNgu+U9PP7o/pKuvOqpyDM86UMOp4QGq2DICu7r7T53okNYVSaoIkd3hWwLTmNjD6+r8UQMDpsd2YuQo5kBX0WOUt2NHwUstwA84k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769155385; c=relaxed/simple; bh=9iKYy3t+e8eBDnpd9Bt1UVB5BMTj+yjnzaBUk5NiFYI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uxdr6oUiwle+CMXv3+8wHxTRKWG2x5gSiopzmvFmM7tstelX9CPFceYXOL77jqyYlucbsZ73CFLMHgP+nVdKGXrcSA8l5/Cd7/dxHTPzL1Uf/WmQo4IIaq1Kt46ZGjXjA7MxNHqV6KQZ/znf4FoQ8HVjtk8muq9NN41HjGsTdSw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LpbBEddZ; 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="LpbBEddZ" Received: by smtp.kernel.org (Postfix) with ESMTPS id 170A8C116D0; Fri, 23 Jan 2026 08:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769155385; bh=9iKYy3t+e8eBDnpd9Bt1UVB5BMTj+yjnzaBUk5NiFYI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=LpbBEddZxMLYatntA3RsUqVEW18c/weqjYN3QW83kZaQWlbmS3HswUCkMovg1Alj8 6FTwif54aRQ2/0Bz9Csh/EW7p8XrGmVtgEJ0zfM0hxFQKzerWO8INEoviz8itUv+CK LZc+wOJBQJGa/yb/rOYtWt+DwBIi4fv+C2I1Qsm49wfdxcPT1aKCOimNHvVtpH+A7a JxBSAp2SJIPYUqTyfjIwHV/DRIu+z3IEv6uxG5QdjcVuDRk9rOM2j/64K9jB8fW021 mZ9xhc2+y51n1bhOj4dYA3RRmjqzTUojoXvNQ78bJZUYoPBRM93qK/sXe8Z+ueLm3e mj/62yaeTIGsg== 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 F1E04D72345; Fri, 23 Jan 2026 08:03:04 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Fri, 23 Jan 2026 08:02:44 +0000 Subject: [PATCH v3 1/5] i2c: xiic: make the clock optional 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: <20260123-i2c-xiic-v3-1-eb7cd4254dfb@nexthop.ai> References: <20260123-i2c-xiic-v3-0-eb7cd4254dfb@nexthop.ai> In-Reply-To: <20260123-i2c-xiic-v3-0-eb7cd4254dfb@nexthop.ai> To: Michal Simek , Andi Shyti Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1769155384; l=1168; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=udjYxPfABO3RAAMRuXRQ2MPbxoAmpLEpeJlZ6QUIK88=; b=1ISL2wGnufwGq5e3UKjSjQXpuX+iQsvKQUdspObxRQveDFo7qaQYA+RLlyXWybCKZgjgQUj74 4AY+GmGZihNCZXTKtr0O8vaOdLn7axz4C86VJlDfTphckQo+rnZLhyM 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 xiic driver is designed to operate without explicit clock configuration when clocks are not specified in the firmware. This functionality is already implemented in xiic_setclk(), which performs an early return when either i2c_clk or input_clk are zero: This condition is satisfied when clocks are missing, as clk_get_rate(NULL) returns zero, allowing the driver to rely on hardware-configured timing. Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 28015d77599d..603a246a1445 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1464,7 +1464,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) mutex_init(&i2c->lock); spin_lock_init(&i2c->atomic_lock); =20 - i2c->clk =3D devm_clk_get_enabled(&pdev->dev, NULL); + i2c->clk =3D devm_clk_get_optional_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"); --=20 2.52.0 From nobody Mon Feb 9 04:45:41 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 648EC331204; Fri, 23 Jan 2026 08:03:05 +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=1769155385; cv=none; b=Rq6yO/4q5wewE6i1Jk3XDnZ4hBXq5jGSStrqEe2WbcIfZXrdprvE+nC1m6v1QGSAVuoYvmldwdYg/rTa1irhDzAe3GBfUtTqwfNRcs0eL9zrxKiCIuV03rfxyAB+ZW5Br5EU3N662eVVEIMq91WfRsid382IL4P7b/ywwhVbRAw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769155385; c=relaxed/simple; bh=Xir6qCWx3Kn1i0hDSDtt04zmgse5Q9Xo6I9ownNJMS0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MBR1h6+FiQa2tFsJ2cVbGQS6Td0vxxF46jTwVozYHTnH9fK7vj3FPuZZ6Jj03qIMMa8V1bIsegcy3d9RDiI7U9DvkgvLYalWUpNUQrNMC1pjg7ibpZzgRqppWf2N9CUgTDBBgsPuTK+aujRVBqS0D90OrfFlv6rrjPHNRuLCEHc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aTB1bj9y; 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="aTB1bj9y" Received: by smtp.kernel.org (Postfix) with ESMTPS id 22BF7C19425; Fri, 23 Jan 2026 08:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769155385; bh=Xir6qCWx3Kn1i0hDSDtt04zmgse5Q9Xo6I9ownNJMS0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=aTB1bj9ypXRsPTKwVFqV7xOuk8x07YzwHaFj4cIA8GQpq3hJnrH6WgvUB6NKE/xyS stiAF0iVs8c2a2/7gv1Us6ULy3bUk2pdEUhQ+8996WAu5IQG7cg+QaL5CeMN3Oz+1I Wp/FzNXwAweSuI8DDG+TrQB8uOhdZ80le0MDTJVuUhKrLC9W7jfFQO8V6BrRa0C5SJ LYWH4N5cMc4dlHwa15EVMmi2YsZ2qEsSZQZNMGis4a/pl9rxHoeGpXMxhTzfvrQ935 6+rrOWDEnSCaY7iAyxyEadtxR5eXdIQetrH30TvrHutPkZ491r072JQ88943hZ+nLJ qI33bJFiiMRBw== 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 10565D72348; Fri, 23 Jan 2026 08:03:05 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Fri, 23 Jan 2026 08:02:45 +0000 Subject: [PATCH v3 2/5] i2c: xiic: switch to managed version of mutex_init 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: <20260123-i2c-xiic-v3-2-eb7cd4254dfb@nexthop.ai> References: <20260123-i2c-xiic-v3-0-eb7cd4254dfb@nexthop.ai> In-Reply-To: <20260123-i2c-xiic-v3-0-eb7cd4254dfb@nexthop.ai> To: Michal Simek , Andi Shyti Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1769155384; l=829; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=jX19wNjldXvkgpDnhpI8JjXsRDG7OWfTod3nsZBV2bo=; b=OKAesYfKMSjHZqJsxbM+6VRSrcQKeu5XI3rbg7EWS0f4Af49BaJVG/nmff/qmIVwbt+paDW+x R+cl09zLzWuACIoSgxvs6nRlqvCtIhtNyDVspfUPhXD0/C64d70dyZP 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 path by switching to a managed version of mutex_init. Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 603a246a1445..79643c27e75d 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1461,7 +1461,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(&pdev->dev, &i2c->lock); + if (ret < 0) + return ret; + spin_lock_init(&i2c->atomic_lock); =20 i2c->clk =3D devm_clk_get_optional_enabled(&pdev->dev, NULL); --=20 2.52.0 From nobody Mon Feb 9 04:45:41 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 6486F318BAE; Fri, 23 Jan 2026 08:03:05 +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=1769155385; cv=none; b=p597Fi5Capce4YrwhQHaO9i/mgpZx1sl3+iLaGI6DbuAyUhb432xilzTLfvCnD8HIzKN9ICH5kQGc0g36hQGLTo3KmAdySYwQBwzpDSVkaNTSBswKjaUI07nqg1N2i8LSTBCxMSC2edCG9xpOVG/27Sw/b7ucG4cAi9/fZK78pc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769155385; c=relaxed/simple; bh=21QgVWJxppsy2WfrsYHM9rd+SKv2elfyVdfo+LCNaKk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IM8rwk8YpXquBqPtaf+w+nrhr0QMTTPD5Ww9LQXv0WUC4f/qYeFDffmH+ARN4UsGj09UilGfBhV5kACqEsUiOvApBUCChozinoOoDg9UyQjD95qsCbfuQ62HhC1p4+vhFy+QbAIdRFiKN1RoDOp9XNLlyA2g/eikcAms0yyfESY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gQ4S7yRW; 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="gQ4S7yRW" Received: by smtp.kernel.org (Postfix) with ESMTPS id 30EB2C19423; Fri, 23 Jan 2026 08:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769155385; bh=21QgVWJxppsy2WfrsYHM9rd+SKv2elfyVdfo+LCNaKk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=gQ4S7yRW9jBcirtXQoDLxxXQ7OFrg+v8oC47p1j0unAgKueMJKV1TAWOdR+sOjZ0S 65462ojbeq2hfapQjw0ZSdz9BG9ORqZDYsx8s2ee4W1T7UMAoEYG1+cvR8KAz6Cc+j ibr3hZw2miCPaIjcDP9AliL+oHibDWrSY57zjzE/wtX2KFtUXKxJGhDq0RaBPElYrn vHRfKT3pt1ZLTNvaR1VvnDClTKH4wYvG4DjhhXcg0UftGt0/y6Sa783jFLaNvowu1z on+PxUT28epixXzAPyAsOlAgFQTBktayxcclGiet/OPMZthJ/3biyiwXrAo4+ghsFe deGtO5u5U5Jzg== 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 238D7D72349; Fri, 23 Jan 2026 08:03:05 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Fri, 23 Jan 2026 08:02:46 +0000 Subject: [PATCH v3 3/5] 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: <20260123-i2c-xiic-v3-3-eb7cd4254dfb@nexthop.ai> References: <20260123-i2c-xiic-v3-0-eb7cd4254dfb@nexthop.ai> In-Reply-To: <20260123-i2c-xiic-v3-0-eb7cd4254dfb@nexthop.ai> To: Michal Simek , Andi Shyti Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1769155384; l=651; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=8+foX4oDtm5Uf+NftOW1CSk/aI5wtgDdkEiHVL5041E=; b=npVAlHweINmY0ziepQn7v7CkJ6Z4uRPbzWZINnPl2eVl5qzOMUYQXmJq17nhmPsl1DCkMUbA/ CQXJFwhdHIyCQAvwsNUCr5F8odKG29+++McehkKAwVUFaTtl5PTuw4w 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. Signed-off-by: Abdurrahman Hussain Reviewed-by: Andrew Lunn --- drivers/i2c/busses/i2c-xiic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 79643c27e75d..52d5c0c5c5c8 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1491,7 +1491,6 @@ static int xiic_i2c_probe(struct platform_device *pde= v) pdev->name, i2c); =20 if (ret < 0) { - dev_err_probe(&pdev->dev, ret, "Cannot claim IRQ\n"); goto err_pm_disable; } =20 --=20 2.52.0 From nobody Mon Feb 9 04:45:41 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 665A9334373; Fri, 23 Jan 2026 08:03:05 +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=1769155385; cv=none; b=nmfIOaULubK1fHNTTgt7bRMaCP3QrT4HTiYXmntjTjNi+omkMS1fvscdX8k68V3TAbuaM1BtRFdtEKcCGJ4Hctek+EgRc7P5V7WZxvsQsNv6NgKGAO0/VlCaSPKZTravsgXM+gbJ9lz9cFOUTUTq3qDLxHFfJPLk/HbR7i0SieE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769155385; c=relaxed/simple; bh=95pm9pT9ahIHrDl5PzXCxnBn8T9VaSAm0YoviS5jmaY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gvdOcoZWlqGeM1FcvZKG2MCtJHJbLuhSvYq9z97m9eVzzpyxzKrTxK/C6E7y8gDxOfZ+MQ10LzKAp1t8Lm/nUYkLF6AUYAVRsr+2v079vawdR7T+lys1qFnOUnUgwYvGon8jp+XA/xupIo52GQO9+biaIq2rf0o1lQZeo5XIwRQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OFDAFhr6; 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="OFDAFhr6" Received: by smtp.kernel.org (Postfix) with ESMTPS id 3F8E5C2BC9E; Fri, 23 Jan 2026 08:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769155385; bh=95pm9pT9ahIHrDl5PzXCxnBn8T9VaSAm0YoviS5jmaY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=OFDAFhr67MNlL4E7XR9TEf32UYdsDhZKV7paszUclc/XQzN8ynUFKFU3NofcPupfd T5aPxJ6qOzkoYs9quApPVFGv2UTU0hJ4ZscEC/9JRRnqcOJwxsk3rRCeB4Cy6KYSoj UPwPvgCpxZHX8zfLuJaGUHIkwo5hc4uBmjqOwBbkO7yWoi1kBTVIh2g90eQlegAEUD 1AUlYQ7qVgzOUsgYArQqxjnq/HIEOmSud5xe0uxPmMEcpmZXqng/8Euegs8Q/Np/HW QiYGu220V/pFBGm0k9ESF1ih2l8tA0hZPYt0ydNmqTw01UZqnVhSLzWCNhITY5uo3U KBX2ZQWS9ydEQ== 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 3651BD7234A; Fri, 23 Jan 2026 08:03:05 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Fri, 23 Jan 2026 08:02:47 +0000 Subject: [PATCH v3 4/5] 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: <20260123-i2c-xiic-v3-4-eb7cd4254dfb@nexthop.ai> References: <20260123-i2c-xiic-v3-0-eb7cd4254dfb@nexthop.ai> In-Reply-To: <20260123-i2c-xiic-v3-0-eb7cd4254dfb@nexthop.ai> To: Michal Simek , Andi Shyti Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1769155384; l=2893; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=pRnnq9ftB1WpZGbAGXJnKnnQsZgU8BUHyOSlFjYZleA=; b=LK2aNS+rfamEhfnknpw98lduE2JhQgnSXDaLzB0zQJf10Ywv2FK6XTB7rBGnGEOwWY1CzzSQ0 H8/KOJs+8LoBbfJREvk48dJiiGuxeDlrROUp3on/Cc1zj+nxUqKuNwF 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. Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 52d5c0c5c5c8..3af2d60d3e32 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,13 +1417,12 @@ 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 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; @@ -1435,12 +1432,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(&pdev->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)) @@ -1457,7 +1451,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(&pdev->dev)); snprintf(i2c->adap.name, sizeof(i2c->adap.name), DRIVER_NAME " %s", pdev->name); =20 @@ -1480,8 +1474,8 @@ 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(&pdev->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; @@ -1495,7 +1489,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) } =20 i2c->singlemaster =3D - of_property_read_bool(pdev->dev.of_node, "single-master"); + device_property_read_bool(&pdev->dev, "single-master"); =20 /* * Detect endianness --=20 2.52.0 From nobody Mon Feb 9 04:45:41 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 8ABCA33B97D; Fri, 23 Jan 2026 08:03:05 +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=1769155385; cv=none; b=T34+RmYYReNAKagwU9kFPljeEAPg8IhB0EYtJFoIfL14k1sRvZIW1SffEUKqbG6oub3zPWq/ylb0pF3LktKOPpL2RQ1j5zXU8ecfkL9n6IMA7V4gW4NEHOnVhLMvX3bgPgmEDdoZkCvoHsVUnxAqrFb5taAFLNgKTo7TSIem8s8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769155385; c=relaxed/simple; bh=g1/bpjPALCXzFTU1aCqorrXRSWoTWnnLLxTvD1XePRM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c5q73EuC56KGu9QYHSrTgKn4DVTSBDkv7GWjdIueDDFSW8yFhpQOPpKAVBckw67mqM3IoRBhbeQSwNtG9ECJpm7PUEjrXW+TfDc1RK46AhdDX7BEGN+AxTkw/B2Idqqbcgs6Vl538byz/YLgVNSU0uR6eUozwflLeJOGePLBeAM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jQcDd3QU; 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="jQcDd3QU" Received: by smtp.kernel.org (Postfix) with ESMTPS id 4D969C2BCAF; Fri, 23 Jan 2026 08:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769155385; bh=g1/bpjPALCXzFTU1aCqorrXRSWoTWnnLLxTvD1XePRM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=jQcDd3QUMiq5RhjifeRiKMJlCG5K2ins0Zlz+MaV/v5Do3u1d3q52FBgw17RIUaau Zzh9hjIaWd66O1Ir/6qmYFs8NUcwLCbNAJ+qibI3E1Hr9vzRQSHFufBSS84w5cvlQJ dqu/tsRXcao+JDNdzrmgfvurBfF/wVlwczpiGO3xjf2HFTgTpUyAkytNtwo+hXJZGo wlatOIbNJCU9Qty3zTouOk97RVliY50Vp7MI9DFesGrxMBkHID6DR4cIAOGO994cSP P5wXZLUFkRhFw/ecej3/cCcWfKTP116rF2YEojykvw1H7E29RDo/SxrrpgDgvLVGfu yUZIizWOZdGSg== 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 45D92D7234B; Fri, 23 Jan 2026 08:03:05 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Fri, 23 Jan 2026 08:02:48 +0000 Subject: [PATCH v3 5/5] i2c: xiic: minor 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: <20260123-i2c-xiic-v3-5-eb7cd4254dfb@nexthop.ai> References: <20260123-i2c-xiic-v3-0-eb7cd4254dfb@nexthop.ai> In-Reply-To: <20260123-i2c-xiic-v3-0-eb7cd4254dfb@nexthop.ai> To: Michal Simek , Andi Shyti Cc: Andy Shevchenko , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1769155384; l=5149; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=dTX1v7vOgEB5f4WNaQT/jsmJZcS4w/ksW0v2dImQznM=; b=YkuZyZUnFWIQcqKGtIzEEqTu0nG2pvhfKHVLBIwNPqZO8JRdoP+A6eOQbjPfDocoF8qn/1Ze8 26xjEhNk3jbDoYp/BLH1klsKrt0PBzwDV52/hdf6qW753oo2jvdLHmM 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 Add a temporary dev variable and reuse it instead of referencing pdev->dev everywhere. Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 60 +++++++++++++++++++++------------------= ---- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 3af2d60d3e32..3c0ec33aefd4 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -1420,6 +1420,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 xiic_version_data *data; @@ -1428,11 +1429,11 @@ static int xiic_i2c_probe(struct platform_device *p= dev) 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 - data =3D device_get_match_data(&pdev->dev); + data =3D device_get_match_data(dev); if (data) i2c->quirks =3D data->quirks; =20 @@ -1444,52 +1445,50 @@ 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; - device_set_node(&i2c->adap.dev, dev_fwnode(&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); =20 - ret =3D devm_mutex_init(&pdev->dev, &i2c->lock); + ret =3D devm_mutex_init(dev, &i2c->lock); if (ret < 0) return ret; =20 spin_lock_init(&i2c->atomic_lock); =20 - i2c->clk =3D devm_clk_get_optional_enabled(&pdev->dev, NULL); + i2c->clk =3D devm_clk_get_optional_enabled(dev, NULL); if (IS_ERR(i2c->clk)) - return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk), + return dev_err_probe(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); - pm_runtime_set_active(i2c->dev); - pm_runtime_enable(i2c->dev); + i2c->dev =3D dev; + pm_runtime_set_autosuspend_delay(dev, XIIC_PM_TIMEOUT); + pm_runtime_use_autosuspend(dev); + pm_runtime_set_active(dev); + pm_runtime_enable(dev); =20 /* SCL frequency configuration */ i2c->input_clk =3D clk_get_rate(i2c->clk); - ret =3D device_property_read_u32(&pdev->dev, "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; =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); =20 if (ret < 0) { goto err_pm_disable; } =20 - i2c->singlemaster =3D - device_property_read_bool(&pdev->dev, "single-master"); + i2c->singlemaster =3D device_property_read_bool(dev, "single-master"); =20 /* * Detect endianness @@ -1505,7 +1504,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) =20 ret =3D xiic_reinit(i2c); if (ret < 0) { - dev_err_probe(&pdev->dev, ret, "Cannot xiic_reinit\n"); + dev_err_probe(dev, ret, "Cannot xiic_reinit\n"); goto err_pm_disable; } =20 @@ -1522,38 +1521,39 @@ static int xiic_i2c_probe(struct platform_device *p= dev) 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 0; =20 err_pm_disable: - pm_runtime_disable(&pdev->dev); - pm_runtime_set_suspended(&pdev->dev); + pm_runtime_disable(dev); + pm_runtime_set_suspended(dev); =20 return ret; } =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); =20 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_disable(&pdev->dev); - pm_runtime_set_suspended(&pdev->dev); - pm_runtime_dont_use_autosuspend(&pdev->dev); + pm_runtime_put_sync(dev); + pm_runtime_disable(dev); + pm_runtime_set_suspended(dev); + pm_runtime_dont_use_autosuspend(dev); } =20 static const struct dev_pm_ops xiic_dev_pm_ops =3D { --=20 2.52.0