public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: media: av7110: fix error code in frontend_init()
       [not found] <20260313-av7110-fix-enodev-v1-1-1788db19a58a.ref@yahoo.pl>
@ 2026-03-13 17:36 ` Tomasz Unger
  2026-03-16  8:33   ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Unger @ 2026-03-13 17:36 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman
  Cc: linux-media, linux-staging, linux-kernel, Tomasz Unger

Return -ENODEV instead of -ENOMEM when no frontend driver is found
for the device. -ENODEV is semantically correct here as the failure
is due to no matching frontend driver being found, not a memory
allocation failure.

Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
 drivers/staging/media/av7110/av7110.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/media/av7110/av7110.c b/drivers/staging/media/av7110/av7110.c
index 607992100baf..7323f550fb72 100644
--- a/drivers/staging/media/av7110/av7110.c
+++ b/drivers/staging/media/av7110/av7110.c
@@ -2237,8 +2237,7 @@ static int frontend_init(struct av7110 *av7110)
 	}
 
 	if (!av7110->fe) {
-		/* FIXME: propagate the failure code from the lower layers */
-		ret = -ENOMEM;
+		ret = -ENODEV;
 		pr_err("A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n",
 		       av7110->dev->pci->vendor, av7110->dev->pci->device,
 		       av7110->dev->pci->subsystem_vendor, av7110->dev->pci->subsystem_device);

---
base-commit: 711ca05c484c6c13582fcf2880a62a3ffdcb6eac
change-id: 20260313-av7110-fix-enodev-fd21468f47f4

Best regards,
-- 
Tomasz Unger <tomasz.unger@yahoo.pl>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging: media: av7110: fix error code in frontend_init()
  2026-03-13 17:36 ` [PATCH] staging: media: av7110: fix error code in frontend_init() Tomasz Unger
@ 2026-03-16  8:33   ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2026-03-16  8:33 UTC (permalink / raw)
  To: Tomasz Unger
  Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, linux-media,
	linux-staging, linux-kernel

On Fri, Mar 13, 2026 at 06:36:52PM +0100, Tomasz Unger wrote:
> Return -ENODEV instead of -ENOMEM when no frontend driver is found
> for the device. -ENODEV is semantically correct here as the failure
> is due to no matching frontend driver being found, not a memory
> allocation failure.
> 
> Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
> ---

Returning -ENOMEM is just as reasonable as -ENODEV.  We're looking at
if ves1820_attach(), ves1x93_attach() or stv0299_attach() etc fail.
Memory allocation failures seem like the most common cause to me.

The FIXME also seems reasonable...  Just leave it as-is until someone
can address it properly.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-03-16  8:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260313-av7110-fix-enodev-v1-1-1788db19a58a.ref@yahoo.pl>
2026-03-13 17:36 ` [PATCH] staging: media: av7110: fix error code in frontend_init() Tomasz Unger
2026-03-16  8:33   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox