From: Alok Tiwari <alok.a.tiwari@oracle.com>
To: robh@kernel.org, tomeu@tomeuvizoso.net, ogabbay@kernel.org,
tzimmermann@suse.de, Frank.Li@nxp.com,
dri-devel@lists.freedesktop.org
Cc: alok.a.tiwarilinux@gmail.com, alok.a.tiwari@oracle.com
Subject: [PATCH] accel/ethosu propagate devm_drm_dev_alloc() error code
Date: Sun, 1 Mar 2026 01:03:59 -0800 [thread overview]
Message-ID: <20260301090411.171060-1-alok.a.tiwari@oracle.com> (raw)
devm_drm_dev_alloc() returns an ERR_PTR() on failure. Use PTR_ERR() rather
than always returning -ENOMEM so the probe path propagates the real error
code such as -ENOMEM, -EINVAL, and -ENODEV.
Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
drivers/accel/ethosu/ethosu_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/accel/ethosu/ethosu_drv.c b/drivers/accel/ethosu/ethosu_drv.c
index 9992193d7338..196871ec2a06 100644
--- a/drivers/accel/ethosu/ethosu_drv.c
+++ b/drivers/accel/ethosu/ethosu_drv.c
@@ -337,7 +337,8 @@ static int ethosu_probe(struct platform_device *pdev)
ethosudev = devm_drm_dev_alloc(&pdev->dev, ðosu_drm_driver,
struct ethosu_device, base);
if (IS_ERR(ethosudev))
- return -ENOMEM;
+ return PTR_ERR(ethosudev);
+
platform_set_drvdata(pdev, ethosudev);
dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(40));
--
2.50.1
next reply other threads:[~2026-03-01 9:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-01 9:03 Alok Tiwari [this message]
2026-03-03 4:00 ` Claude review: accel/ethosu propagate devm_drm_dev_alloc() error code Claude Code Review Bot
2026-03-03 4:00 ` Claude Code Review Bot
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=20260301090411.171060-1-alok.a.tiwari@oracle.com \
--to=alok.a.tiwari@oracle.com \
--cc=Frank.Li@nxp.com \
--cc=alok.a.tiwarilinux@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ogabbay@kernel.org \
--cc=robh@kernel.org \
--cc=tomeu@tomeuvizoso.net \
--cc=tzimmermann@suse.de \
/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