From nobody Thu Mar 5 16:35: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 1832730ACE8; Mon, 23 Feb 2026 15:59:20 +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=1771862360; cv=none; b=f6kKeHxZ7USvqBZ/nne8LCwQ/Cee/exin1v6mkQKlXhYoQHZ9dKM34YV8kitZ+6wfcG8d+mpBnxVCWUUikoyI50bGNRVr0yLllQNkv2p2A6u3E1TyO39jxiJT+3/PYQbeBS08rUf/0hHQSb5GHYozcmKyw2/v5vO+lrrMik+YmM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771862360; c=relaxed/simple; bh=sNUMCjC/edNNrfJ9N5Yw2HyQVYhOfmsHMGbbuNPu+Fc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qnBcDV/1g5R/LpjlkTNzuWsnu4RyMMqGNBw35JlciOqiLskqWK7VfKFxY1X0aZpxjK5kBXevQD+b0sx5imWyZE6oUL0mojLwd/n5jOVCSOl8wYUFSQoWdslaSaUzDFzOQdu12UX0KOvYY5kQZBBplBLz1CAht7oGBP5wKFggB30= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AkRhInjH; 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="AkRhInjH" Received: by smtp.kernel.org (Postfix) with ESMTPS id D37ACC2BC9E; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771862359; bh=sNUMCjC/edNNrfJ9N5Yw2HyQVYhOfmsHMGbbuNPu+Fc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=AkRhInjH51fBhdjZ4XUT2MLA52L+TswWhdbw2ERy+PBbnlNt5YwchNJTBhZtMXpUj 6bsopWxi+Cm/vuXQtLu4abNRlOGbICevwnw/cdBbasppfXtl+NDDeod1vlismRmKuN YcyN6PaoOTqkc60dlVc5FkJrhujHh4gphUaNrVRdcqINpQNB2Je3PPM3ZZoQ+6jCi3 fDsWfCldRJfPd3onmknV74OZ3PVDQL/ysBAc6sZRmoS/pGgDoAGnMQhjZVRPYS0kkK 2x/4kMI0xMALadzjyHXkK3wOXa8+Ms61rdqj0u+KwPmT3Wp8jd9LayFXPtFAS7NiVq 2soGsDXV237Ug== 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 CA973EF5865; Mon, 23 Feb 2026 15:59:19 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 23 Feb 2026 15:59:18 +0000 Subject: [PATCH v12 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: <20260223-i2c-xiic-v12-3-b6c9ce4e4f3c@nexthop.ai> References: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@nexthop.ai> In-Reply-To: <20260223-i2c-xiic-v12-0-b6c9ce4e4f3c@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=1771862359; l=3070; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=9F2oFcqzvLc5raKmRaUuz3YdJei2/cMdcAQn1OeCoq0=; b=/W0xDE+k/+F40SNAzgQNuMFD1cDoIW54jyie115F+/LqMWFUqscX1wiXpxpOkxojbnd9YwsX9 1zoz4nlL3iGD3XtdynudSm3RVXng6/lQris26KDh1p9ToMNAgYbNzDf 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 making them work for ACPI platforms. Reviewed-by: Andy Shevchenko Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 99286af2a0d7..c7f641e291a2 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,14 @@ 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 fwnode_handle *fwnode =3D dev_fwnode(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 +1434,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 +1453,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, fwnode); snprintf(i2c->adap.name, sizeof(i2c->adap.name), DRIVER_NAME " %s", pdev->name); =20 @@ -1482,8 +1477,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 +1488,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