media: platform: Use dev_err_probe instead of dev_err
Subsystems (3)
PATCH v2 1/1 media: platform: Use dev_err_probe instead of dev_err
It is possible that dma_request_chan will return EPROBE_DEFER, which means that dma->xdev->dev is not ready yet. In this case, dev_err(dma->xdev->dev), there will be no output. This patch fixes the bug.
--- drivers/media/platform/xilinx/xilinx-dma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/media/platform/xilinx/xilinx-dma.c +2 -3
@@ -708,9 +708,8 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,snprintf (name,sizeof (name),"port%u" , port); dma->dma =dma_request_chan (dma->xdev->dev, name);if (IS_ERR (dma->dma)) { - ret =PTR_ERR (dma->dma); -if (ret != -EPROBE_DEFER ) -dev_err (dma->xdev->dev,"no VDMA channel found\n" ); + ret =dev_err_probe (dma->xdev->dev,PTR_ERR (dma->dma), +"no VDMA channel found\n" ); goto error; }
Signature · 1 line
2.25.1
Hi Wang,
Thank you for the patch.
Quoted 4 lines · Wang Ming
It is possible that
dma_request_chanwill returnEPROBE_DEFER, which means thatdma->xdev->devis not ready yet. In this case,dev_err(dma->xdev->dev), there will be no output. This patch fixes the bug.
It's not a bug. The existing code works as expected. dev_err_probe() is nicer though, as it records the reason for the probe deferral. Here's a proposal for a better commit message:
It is possible that dma_request_chan() returns EPROBE_DEFER, in which case the driver defers probing without printing any message. Use dev_err_probe() to record the probe deferral cause and ease debugging.
If you're fine with this, there's no need to resubmit, I'll update the commit message locally and merge the patch.
Quoted 21 lines
Signed-off-by Wang Ming <[email protected]>--- drivers/media/platform/xilinx/xilinx-dma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/media/platform/xilinx/xilinx-dma.c +2
-3@@ -708,9 +708,8 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,snprintf (name,sizeof (name),"port%u" , port); dma->dma =dma_request_chan (dma->xdev->dev, name);if (IS_ERR (dma->dma)) { - ret =PTR_ERR (dma->dma); -if (ret != -EPROBE_DEFER ) -dev_err (dma->xdev->dev,"no VDMA channel found\n" ); + ret =dev_err_probe (dma->xdev->dev,PTR_ERR (dma->dma), +"no VDMA channel found\n" ); goto error; }
Signature · 3 lines
Regards, Laurent Pinchart
Laurent Pinchart
maintainerQuoted 28 lines · Laurent Pinchart
Hi Wang,
Thank you for the patch.
Quoted 4 lines · Wang Ming
It is possible that
dma_request_chanwill returnEPROBE_DEFER, which means thatdma->xdev->devis not ready yet. In this case,dev_err(dma->xdev->dev), there will be no output. This patch fixes the bug.It's not a bug. The existing code works as expected.
dev_err_probe()is nicer though, as it records the reason for the probe deferral. Here's a proposal for a better commit message:It is possible that
dma_request_chan()returnsEPROBE_DEFER, in which case the driver defers probing without printing any message. Usedev_err_probe()to record the probe deferral cause and ease debugging.If you're fine with this, there's no need to resubmit, I'll update the commit message locally and merge the patch.
Reviewed-by Laurent Pinchart <[email protected]>Quoted 5 lines
Signed-off-by Wang Ming <[email protected]>--- drivers/media/platform/xilinx/xilinx-dma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
Quoted 13 lines
drivers/media/platform/xilinx/xilinx-dma.c int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma, · line 712
Quoted 13 lines
drivers/media/platform/xilinx/xilinx-dma.c +2
-3@@ -708,9 +708,8 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,snprintf (name,sizeof (name),"port%u" , port); dma->dma =dma_request_chan (dma->xdev->dev, name);if (IS_ERR (dma->dma)) { - ret =PTR_ERR (dma->dma); -if (ret != -EPROBE_DEFER ) -dev_err (dma->xdev->dev,"no VDMA channel found\n" ); + ret =dev_err_probe (dma->xdev->dev,PTR_ERR (dma->dma), +"no VDMA channel found\n" );
I forgot to mention that the message should be aligned:
ret = dev_err_probe(dma->xdev->dev, PTR_ERR(dma->dma), "no VDMA channel found\n");
I can fix this locally too.
Quoted 3 lines
Quoted 3 lines
drivers/media/platform/xilinx/xilinx-dma.c +0
-0goto error; }
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 50 lines · Laurent Pinchart
[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
Quoted 27 lines · Laurent Pinchart
Hi Wang,
Thank you for the patch.
Quoted 4 lines · Wang Ming
It is possible that
dma_request_chanwill returnEPROBE_DEFER, which means thatdma->xdev->devis not ready yet. In this case,dev_err(dma->xdev->dev), there will be no output. This patch fixes the bug.It's not a bug. The existing code works as expected.
dev_err_probe()is nicer though, as it records the reason for the probe deferral. Here's a proposal for a better commit message:It is possible that
dma_request_chan()returnsEPROBE_DEFER, in which case the driver defers probing without printing any message. Usedev_err_probe()to record the probe deferral cause and ease debugging.If you're fine with this, there's no need to resubmit, I'll update the commit message locally and merge the patch.
Reviewed-by Laurent Pinchart <[email protected]>Quoted 5 lines
Signed-off-by Wang Ming <[email protected]>--- drivers/media/platform/xilinx/xilinx-dma.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)Quoted 13 lines
drivers/media/platform/xilinx/xilinx-dma.c int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma, · line 712
Quoted 13 lines
drivers/media/platform/xilinx/xilinx-dma.c +2
-3@@ -708,9 +708,8 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,snprintf (name,sizeof (name),"port%u" , port); dma->dma =dma_request_chan (dma->xdev->dev, name);if (IS_ERR (dma->dma)) { - ret =PTR_ERR (dma->dma); -if (ret != -EPROBE_DEFER ) -dev_err (dma->xdev->dev,"no VDMA channel found\n" ); + ret =dev_err_probe (dma->xdev->dev,PTR_ERR (dma->dma), +"no VDMA channel found\n" );I forgot to mention that the message should be aligned:
ret = dev_err_probe(dma->xdev->dev, PTR_ERR(dma->dma), "no VDMA channel found\n");I can fix this locally too.
Quoted 7 lines
Quoted 3 lines
drivers/media/platform/xilinx/xilinx-dma.c int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma, · line 715
Quoted 3 lines
drivers/media/platform/xilinx/xilinx-dma.c +0
-0goto error; }--
Regards,Laurent Pinchart
Okay
thank you.
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel