From nobody Tue Jan 27 00:30:01 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 A20EE34A3A2; Mon, 26 Jan 2026 17:08:21 +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=1769447301; cv=none; b=TbqNuUK+mvky1m8uhKAy+Q8WGkohGuASSpAbktoPphtX1otu2E13X0P11BhLqObHT65lH2SDp7lkqNLcZh0fzenuLtln9sjPSVTO+/QUOKTOBx+ldG0L4x/lUndJnh24bOYAtPYzgDP0RuQwfM4gkyA+SBTgNZm/G61HUrvia/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769447301; c=relaxed/simple; bh=1+b8lUkKws+4oEsMZXB1wLVI8XlSqyA6yVS7eYU/bSw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BxKHbujg10iL9WDtUDHVIcojkp8Cz0/f6TAGOJWTcAkKXFo37x27zzIgKgDil2UOX2884h1L98S7LEOCTAxeqXZxVRYRVA1R9/WslKdOu9v6e/I3sAzIGVqV7Etm5E+EzcSuyCUtH1CFn6fI87Q/X9jaIhxCtqfJW59tRHyUGFM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VCwOQUZO; 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="VCwOQUZO" Received: by smtp.kernel.org (Postfix) with ESMTPS id 6B215C2BCB0; Mon, 26 Jan 2026 17:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769447301; bh=1+b8lUkKws+4oEsMZXB1wLVI8XlSqyA6yVS7eYU/bSw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=VCwOQUZOCSYaskgQApsBN5gP4MdATlYA/oybjf3DowqdedzHVWj0KIAJZcMCldJLU ST4kZU9umA62YNIFztewFdK1pqxYrT5WWIo8u6qBpJAuGY6D67rqbx8HSTy1XdTY/C Zur5B0RBbDhQ+eaQAuPaDbiNybLPy+cOwkU8IngSaZfb3ipi6BFvQiYzTBXjKGWWgF 0+BaxO+kWTQz3ySk7o04xI3gENfhe6itwZ8QwLGnY5J987uEGhkwbJwS3YwEH0Hku4 WSZBufgErp31/aRVaoK8ipU/r0/k6XHvcob087BUaHF+RI3/+pgmDK6eHxmUMxnzGq CZjiirO9XzvDg== 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 610AED19509; Mon, 26 Jan 2026 17:08:21 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 26 Jan 2026 17:08:20 +0000 Subject: [PATCH v5 5/6] 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: <20260126-i2c-xiic-v5-5-88a16a28721c@nexthop.ai> References: <20260126-i2c-xiic-v5-0-88a16a28721c@nexthop.ai> In-Reply-To: <20260126-i2c-xiic-v5-0-88a16a28721c@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=1769447300; l=3090; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=MTSepaq3p0JGZqPpWg0lyiFNCHgVsT/ZL3hMvZ5oBjc=; b=R8a8v2Vp3MRfWptAIlCRVcI0Vv218LiSEta9mVSRc2ed+hox/w3jYxijOEnm9B75myVfcbkOU psGlDSJ0hwVCUPl6PhDRdKp6/ZDXI5u7P1B03/z6VfyL8qR+knEyBiS 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 | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index a06597bbf6fc..09a4b532d55d 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,21 +1476,18 @@ static int xiic_i2c_probe(struct platform_device *p= dev) =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; =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) 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