Re: [PATCH 4/4] mailbox: mailbox-test: add support for separate tx/rx buffer with single channel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






On 12/02/16 09:15, Lee Jones wrote:
On Thu, 11 Feb 2016, Sudeep Holla wrote:


[...]

@@ -294,9 +295,13 @@ static int mbox_test_probe(struct platform_device *pdev)

  	/* It's okay for MMIO to be NULL */
  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	tdev->mmio = devm_ioremap_resource(&pdev->dev, res);
-	if (IS_ERR(tdev->mmio))
-		tdev->mmio = NULL;
+	tdev->tx_mmio = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(tdev->tx_mmio))
+		tdev->tx_mmio = NULL;

Nit: I'd prefer to see a new line separator here.


OK will add it

+	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+	tdev->rx_mmio = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(tdev->rx_mmio))
+		tdev->rx_mmio = tdev->tx_mmio;

  	tdev->tx_channel = mbox_test_request_channel(pdev, "tx");
  	tdev->rx_channel = mbox_test_request_channel(pdev, "rx");
@@ -304,6 +309,9 @@ static int mbox_test_probe(struct platform_device *pdev)
  	if (!tdev->tx_channel && !tdev->rx_channel)
  		return -EPROBE_DEFER;

+	if (!tdev->rx_channel && (tdev->rx_mmio != tdev->tx_mmio))
+		tdev->rx_channel = tdev->tx_channel;
+
  	tdev->dev = &pdev->dev;
  	platform_set_drvdata(pdev, tdev);

Otherwise code looks good.  Nice extension.


Thanks for the review.

Acked-by: Lee Jones <lee.jones@xxxxxxxxxx>


--
Regards,
Sudeep
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux