From: Frank Li <Frank.li@nxp.com>
To: "Peng Fan (OSS)" <peng.fan@oss.nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH 2/3] soc: imx: Use dev_err_probe() for i.MX9
Date: Thu, 18 Dec 2025 10:43:11 -0500 [thread overview]
Message-ID: <aUQhDwPP1nNAPG0b@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20251217-soc-imx9-fix-v1-2-0c763c2dbe29@nxp.com>
On Wed, Dec 17, 2025 at 08:42:08PM +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> Use dev_err_probe() to simplify code. No functional changes.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/soc/imx/soc-imx9.c | 20 +++++++-------------
> 1 file changed, 7 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/soc/imx/soc-imx9.c b/drivers/soc/imx/soc-imx9.c
> index 0b1c59c7ddb244549bfeedc47ae6e8d83c20b39b..d9a686299c5f710bb9988c55ed601fc9d9f19229 100644
> --- a/drivers/soc/imx/soc-imx9.c
> +++ b/drivers/soc/imx/soc-imx9.c
> @@ -31,10 +31,8 @@ static int imx9_soc_probe(struct platform_device *pdev)
> return -ENOMEM;
>
> err = of_property_read_string(of_root, "model", &attr->machine);
> - if (err) {
> - pr_err("%s: missing model property: %d\n", __func__, err);
> - return err;
> - }
> + if (err)
> + return dev_err_probe(dev, err, "%s: missing model property\n", __func__);
>
> attr->family = devm_kasprintf(dev, GFP_KERNEL, "Freescale i.MX");
>
> @@ -46,10 +44,8 @@ static int imx9_soc_probe(struct platform_device *pdev)
> * res.a3: uid[63:0];
> */
> arm_smccc_smc(IMX_SIP_GET_SOC_INFO, 0, 0, 0, 0, 0, 0, 0, &res);
> - if (res.a0 != SMCCC_RET_SUCCESS) {
> - pr_err("%s: SMC failed: 0x%lx\n", __func__, res.a0);
> - return -EINVAL;
> - }
> + if (res.a0 != SMCCC_RET_SUCCESS)
> + return dev_err_probe(dev, -EINVAL, "%s: SMC failed: 0x%lx\n", __func__, res.a0);
>
> soc_id = SOC_ID(res.a1);
> rev_major = SOC_REV_MAJOR(res.a1);
> @@ -63,11 +59,9 @@ static int imx9_soc_probe(struct platform_device *pdev)
> attr->serial_number = devm_kasprintf(dev, GFP_KERNEL, "%016llx%016llx", uid127_64, uid63_0);
>
> sdev = soc_device_register(attr);
> - if (IS_ERR(sdev)) {
> - err = PTR_ERR(sdev);
> - pr_err("%s failed to register SoC as a device: %d\n", __func__, err);
> - return err;
> - }
> + if (IS_ERR(sdev))
> + return dev_err_probe(dev, PTR_ERR(sdev),
> + "%s failed to register SoC as a device\n", __func__);
>
> return 0;
> }
>
> --
> 2.37.1
>
next prev parent reply other threads:[~2025-12-18 15:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-17 12:42 [PATCH 0/3] soc: imx: misc clean up and support i.MX9[4,52] Peng Fan (OSS)
2025-12-17 12:42 ` [PATCH 1/3] soc: imx: Use device-managed APIs for i.MX9 Peng Fan (OSS)
2025-12-18 15:41 ` Frank Li
2025-12-17 12:42 ` [PATCH 2/3] soc: imx: Use dev_err_probe() " Peng Fan (OSS)
2025-12-18 15:43 ` Frank Li [this message]
2025-12-17 12:42 ` [PATCH 3/3] soc: imx: Spport i.MX9[4,52] Peng Fan (OSS)
2025-12-18 15:44 ` Frank Li
2025-12-31 6:48 ` [PATCH 0/3] soc: imx: misc clean up and support i.MX9[4,52] Peng Fan
2026-01-17 5:38 ` Shawn Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aUQhDwPP1nNAPG0b@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox