From nobody Tue Feb 10 03:45:20 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 374E829ACDD; 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=WD9wK5k31wEys8KyJg5ybQq3CWjvwChbDga8cX3hejIQ4Yyh4+d1ciW3/TfKGBFbX9zGu1VBxsqBtFWDl3f7Izvi0H4GtWcPQNx91T9r8tJ7NZwn8pYI6Lsfc9AtiJZIW8p3voUscFG11DWjBPn+IAFjU5EjQmkIgJs1dBabHI8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769547845; c=relaxed/simple; bh=kwaRImWYg42K+aY7Yj1EEUa3493meF935J1y+7q5aNE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KAA1y57itqkfTKIjLu7KirkoBKaIJ4Z704NG5vrg3YtETBMl42vGPruVlvLzKdTqTOAvG3Cqey7XX9201VEAJ+ir235+yk2p3I4xpA/0XFFGAiGTGGPoOV3v/SP4n+JDcGpILxczy7/21+unY7xdyIHKdrvnx3g6FYuNtEkCYTE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TfAJv4nE; 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="TfAJv4nE" Received: by smtp.kernel.org (Postfix) with ESMTPS id 135ACC2BCB4; 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=kwaRImWYg42K+aY7Yj1EEUa3493meF935J1y+7q5aNE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=TfAJv4nE8fTdYoW+MBJT9fGm1hbbZpzBrbP6dLgoAULCsZZ2FDkOJWrmwO2xrqTb1 5kLF01mS4GjhpiGfK2LP1hugMKIRmmSgruXg0EqDBR6Qcp08QO+B5x9Lz5gJndFzDS p7VbRY/IpCZd6t1debSIAGzRs9TaxfmFqcniOo2kX7UtgFH86KvQzZatX0E02O0dlz Zb3ft1L+wssR+UUsaERgFSOr60/mxnkSZbezsUkXSOHmn6o4xtR9bGELHWLS1qgFQj SGopLXiMveQpGRPKoHPeHMDxnhikw/d/56Y494KMYcBDvn19NDNDv9ZUdjPACOQaHS jBtIK6GwzV0mA== 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 075D2D2FEE7; Tue, 27 Jan 2026 21:04:05 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Tue, 27 Jan 2026 21:04:00 +0000 Subject: [PATCH v6 6/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: <20260127-i2c-xiic-v6-6-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=3827; i=abdurrahman@nexthop.ai; s=20260119; h=from:subject:message-id; bh=uxPAvhcYc0WHWa8oXBzw81pLyTuN4OEMllhdK256H4Y=; b=scx2LdHzGKyO8yUxss6cyX1RD42DlSed1OoAXRJwY7xdnvX8eHklSmU53jl+9+gNj8Y9gk92e z8Eo+TVPOmfBu04dXea51qo0CSR3jb/SI6/VAEbdz3NDQXY8JmNkKE/ 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. Signed-off-by: Abdurrahman Hussain --- drivers/i2c/busses/i2c-xiic.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 73fc8f8cb5d4..9b763d8dbe84 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); @@ -1464,12 +1464,13 @@ static int xiic_i2c_probe(struct platform_device *p= dev) =20 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); + 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 @@ -1503,7 +1503,7 @@ static int xiic_i2c_probe(struct platform_device *pde= v) =20 ret =3D xiic_reinit(i2c); if (ret) - return dev_err_probe(&pdev->dev, ret, "Cannot xiic_reinit\n"); + return dev_err_probe(dev, ret, "Cannot xiic_reinit\n"); =20 /* add i2c adapter to i2c tree */ ret =3D i2c_add_adapter(&i2c->adap); @@ -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); - - if (ret < 0) - dev_warn(&pdev->dev, "Failed to activate device for removal (%pe)\n", + ret =3D pm_runtime_get_sync(dev); + if (ret) + 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