Skip to contentSkip to conversation

usb: musb: musb_cppi41: Update an error message

PATCH In review Alexandre Bailon 2 participants 2 messages May 19, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 usb: musb: musb_cppi41: Update an error message

If dma_request_slave_channel() failed to return a channel, then the driver will print an error and request to defer probe, regardless of the cause of the failure.
Defer if the DMA is not ready yet otherwise print an error.

---
 drivers/usb/musb/musb_cppi41.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/usb/musb/musb_cppi41.c +6 -4
index e7c8b1b..2c6ad93 100644
@@ -673,12 +673,14 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
 		musb_dma->status = MUSB_DMA_STATUS_FREE;
 		musb_dma->max_len = SZ_4M;
 
-		dc = dma_request_slave_channel(dev->parent, str);
-		if (!dc) {
-			dev_err(dev, "Failed to request %s.\n", str);
-			ret = -EPROBE_DEFER;
+		dc = dma_request_chan(dev->parent, str);
+		if (IS_ERR(dc)) {
+			ret = PTR_ERR(dc);
+			if (ret != -EPROBE_DEFER)
+				dev_err(dev, "Failed to request %s.\n", str);
 			goto err;
 		}
+
 		cppi41_channel->dc = dc;
 	}
 	return 0;
Signature · 6 lines
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reviewed-by
#2 lore raw
In reply to a message not in the archive
Quoted 4 lines · Alexandre Bailon

If dma_request_slave_channel() failed to return a channel, then the driver will print an error and request to defer probe, regardless of the cause of the failure.
Defer if the DMA is not ready yet otherwise print an error.

The patch summary (Subject) doesn't really reflect what you're doing here (only deferring probe when actually requested).

But the patch itself otherwise looks good now.

Quoted 1 line

With a more descriptive summary you can add my:

Quoted 11 lines
---
 drivers/usb/musb/musb_cppi41.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/usb/musb/musb_cppi41.c +0 -0
index e7c8b1b..2c6ad93 100644
@@ -673,12 +673,14 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller)
 		musb_dma->status = MUSB_DMA_STATUS_FREE;
 		musb_dma->max_len = SZ_4M;

drivers/usb/musb/musb_cppi41.c static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller) · line 680

Quoted 10 lines
drivers/usb/musb/musb_cppi41.c +5 -4
 
-		dc = dma_request_slave_channel(dev->parent, str);
-		if (!dc) {
-			dev_err(dev, "Failed to request %s.\n", str);
-			ret = -EPROBE_DEFER;
+		dc = dma_request_chan(dev->parent, str);
+		if (IS_ERR(dc)) {
+			ret = PTR_ERR(dc);
+			if (ret != -EPROBE_DEFER)
+				dev_err(dev, "Failed to request %s.\n", str);

Perhaps also include the errno here now?

drivers/usb/musb/musb_cppi41.c static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller) · line 686

Quoted 6 lines
drivers/usb/musb/musb_cppi41.c +1 -0
 			goto err;
 		}
+
 		cppi41_channel->dc = dc;
 	}
 	return 0;

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html