From nobody Mon Feb 9 11:47:12 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 319AE29AAE3; Tue, 27 Jan 2026 21:04: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=1769547845; cv=none; b=H0HcX+nJQiYw3xWwkXDz+ygMgWyKDnDL1FowFHu150yuAEEM96+/FH01PIuz/7b5a4CrQd5clULkBv6Y+2rpUZ4GnAXITpJhCG1fLlDl/C1u3a5DQwcKYMRUos+qPd9ItFnP05PAl9vKjrMZsSKI04jZjkBtl0g2KYoxn1FGGeg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769547845; c=relaxed/simple; bh=0mC+GzegM3NUd5rZ8m6lJrPIK5v+NNpTjHvceYgA79I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=u6BRlDdFINJqnNyiBk1lSUUU5PlQvUFsBoemtPafA4Wha1QRnAfROp283oY6jdWmZ42f8KiE+4OgWfuVbQwhn3bKdHvysNwThNRYxDMDkNgTKoyGlgsIFyBbdg/QUnqoyQHZVf2LYNU/9wFaphS1PTCoBZqhWo6TLiMPsRZ+5FU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l/8NXCub; 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="l/8NXCub" Received: by smtp.kernel.org (Postfix) with ESMTPS id 0727AC2BCB3; Tue, 27 Jan 2026 21:04:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769547845; bh=0mC+GzegM3NUd5rZ8m6lJrPIK5v+NNpTjHvceYgA79I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=l/8NXCub5YbVJsI13yDNSioZhbp/JeIZiHAIsGfTkq7+QdSpe0oWiw0pJ3AZVA8J3 nXh0JJY1MzPeC67ppIlo1cCbe8fheKluFGLDTXa2bR5SiwK5JO9T6dKHMJ3vaPYXEm jmp73NPUYY1VmhCM+3qfS1breJS5aUYioCmaFnL3OV0lq7vxefzaMyWro95kmO+QR4 ofomzSnNs4Wq1hQJdBzwKhhUvrzLuoPRsxEDDx6a6ut1INw2UztnhCF3+acveSks1W myF3IHj7v4zp0T4n9Kt/znSc/x8g34eBM7nLetNfyWUQZi7VrSACqD1Q849XlBxSiD odiy06O0ltudA== 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 E956BD2FEDF; Tue, 27 Jan 2026 21:04:04 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Tue, 27 Jan 2026 21:03:59 +0000 Subject: [PATCH v6 5/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: <20260127-i2c-xiic-v6-5-e82e2f6f657c@nexthop.ai> References: <20260127-i2c-xiic-v6-0-e82e2f6f657c@nexthop.ai> In-Reply-To: <20260127-i2c-xiic-v6-0-e82e2f6f657c@nexthop.ai> To: Michal Simek , Andi Shyti , Rob Herring , Krzysztof Kozlowski , Conor Dooley , info@mocean-labs.com 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=1769547843; l=2930; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=8LQGUBdxo4/y/3bZnRryJsF+5KUiwALWt7Kxrp3rDYo=; b=XBa7Y31qCX7MFBy9/EyxDvq+kUlW7UNEvsZ8Med6ED00xLT7N2SVnYOlLYJMjCIUY12ZUI7vU /PX9jssSgdXDmpAIk05nBUKIqMj6jmesKN23jag5CNyWaNI0RicDMdZ 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, 6 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 95242d39f554..73fc8f8cb5d4 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