android: ion-test: addr error message about dmabuf
authorCho KyongHo <pullip.cho@samsung.com>
Tue, 6 Feb 2018 16:21:23 +0000 (01:21 +0900)
committerSangwook Ju <sw.ju@samsung.com>
Mon, 14 May 2018 10:45:22 +0000 (19:45 +0900)
It is useful to distinguish where the error is returned.

Change-Id: I32a3ea5a81f7599fadf1d282fd2776305a0f749d
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/staging/android/ion/ion_test.c

index 8e8485c81eee4467894d36574d0eebd58cd265a7..b1b60ce906009068c6af7e358baed0ea0bff0426 100644 (file)
@@ -54,12 +54,18 @@ static int ion_handle_test_dma(struct device *dev, struct dma_buf *dma_buf,
        unsigned long offset_page;
 
        attach = dma_buf_attach(dma_buf, dev);
-       if (IS_ERR(attach))
+       if (IS_ERR(attach)) {
+               dev_err(dev, "%s: failed to attach dmabuf (err %ld)\n",
+                       __func__, PTR_ERR(attach));
                return PTR_ERR(attach);
+       }
 
        table = dma_buf_map_attachment(attach, dir);
-       if (IS_ERR(table))
+       if (IS_ERR(table)) {
+               dev_err(dev, "%s: failed to map dmabuf (err %ld)\n",
+                       __func__, PTR_ERR(table));
                return PTR_ERR(table);
+       }
 
        offset_page = offset >> PAGE_SHIFT;
        offset %= PAGE_SIZE;