bus: mhi: ep: Rename read_from_host() and write_to_host() APIs
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Mon, 27 Nov 2023 08:27:37 +0000 (13:57 +0530)
committerManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thu, 14 Dec 2023 06:28:53 +0000 (11:58 +0530)
In the preparation for adding async API support, let's rename the existing
APIs to read_sync() and write_sync() to make it explicit that these APIs
are used for synchronous read/write.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/bus/mhi/ep/main.c
drivers/bus/mhi/ep/ring.c
drivers/pci/endpoint/functions/pci-epf-mhi.c
include/linux/mhi_ep.h

index b9334d548c4100e5824f1680b089fdf732180228..88e189a8463a9514441df9cc820e645136bb95f9 100644 (file)
@@ -377,7 +377,7 @@ static int mhi_ep_read_channel(struct mhi_ep_cntrl *mhi_cntrl,
                buf_info.size = tr_len;
 
                dev_dbg(dev, "Reading %zd bytes from channel (%u)\n", tr_len, ring->ch_id);
-               ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
+               ret = mhi_cntrl->read_sync(mhi_cntrl, &buf_info);
                if (ret < 0) {
                        dev_err(&mhi_chan->mhi_dev->dev, "Error reading from channel\n");
                        return ret;
@@ -539,7 +539,7 @@ int mhi_ep_queue_skb(struct mhi_ep_device *mhi_dev, struct sk_buff *skb)
                buf_info.size = tr_len;
 
                dev_dbg(dev, "Writing %zd bytes to channel (%u)\n", tr_len, ring->ch_id);
-               ret = mhi_cntrl->write_to_host(mhi_cntrl, &buf_info);
+               ret = mhi_cntrl->write_sync(mhi_cntrl, &buf_info);
                if (ret < 0) {
                        dev_err(dev, "Error writing to the channel\n");
                        goto err_exit;
index 7ea952860def445754f6461d1a8bf8a1f9ff9af2..aeb53b2c34a8cd859393529d0c8860462bc687ed 100644 (file)
@@ -48,7 +48,7 @@ static int __mhi_ep_cache_ring(struct mhi_ep_ring *ring, size_t end)
                buf_info.host_addr = ring->rbase + (start * sizeof(struct mhi_ring_element));
                buf_info.dev_addr = &ring->ring_cache[start];
 
-               ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
+               ret = mhi_cntrl->read_sync(mhi_cntrl, &buf_info);
                if (ret < 0)
                        return ret;
        } else {
@@ -56,7 +56,7 @@ static int __mhi_ep_cache_ring(struct mhi_ep_ring *ring, size_t end)
                buf_info.host_addr = ring->rbase + (start * sizeof(struct mhi_ring_element));
                buf_info.dev_addr = &ring->ring_cache[start];
 
-               ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
+               ret = mhi_cntrl->read_sync(mhi_cntrl, &buf_info);
                if (ret < 0)
                        return ret;
 
@@ -65,7 +65,7 @@ static int __mhi_ep_cache_ring(struct mhi_ep_ring *ring, size_t end)
                        buf_info.dev_addr = &ring->ring_cache[0];
                        buf_info.size = end * sizeof(struct mhi_ring_element);
 
-                       ret = mhi_cntrl->read_from_host(mhi_cntrl, &buf_info);
+                       ret = mhi_cntrl->read_sync(mhi_cntrl, &buf_info);
                        if (ret < 0)
                                return ret;
                }
@@ -143,7 +143,7 @@ int mhi_ep_ring_add_element(struct mhi_ep_ring *ring, struct mhi_ring_element *e
        buf_info.dev_addr = el;
        buf_info.size = sizeof(*el);
 
-       return mhi_cntrl->write_to_host(mhi_cntrl, &buf_info);
+       return mhi_cntrl->write_sync(mhi_cntrl, &buf_info);
 }
 
 void mhi_ep_ring_init(struct mhi_ep_ring *ring, enum mhi_ep_ring_type type, u32 id)
index ec5f4a38178bb1693899001545839c526c4abb7c..2c5b627eb5ee64e26505f451fd6f348b8c86edff 100644 (file)
@@ -536,11 +536,11 @@ static int pci_epf_mhi_link_up(struct pci_epf *epf)
        mhi_cntrl->alloc_map = pci_epf_mhi_alloc_map;
        mhi_cntrl->unmap_free = pci_epf_mhi_unmap_free;
        if (info->flags & MHI_EPF_USE_DMA) {
-               mhi_cntrl->read_from_host = pci_epf_mhi_edma_read;
-               mhi_cntrl->write_to_host = pci_epf_mhi_edma_write;
+               mhi_cntrl->read_sync = pci_epf_mhi_edma_read;
+               mhi_cntrl->write_sync = pci_epf_mhi_edma_write;
        } else {
-               mhi_cntrl->read_from_host = pci_epf_mhi_iatu_read;
-               mhi_cntrl->write_to_host = pci_epf_mhi_iatu_write;
+               mhi_cntrl->read_sync = pci_epf_mhi_iatu_read;
+               mhi_cntrl->write_sync = pci_epf_mhi_iatu_write;
        }
 
        /* Register the MHI EP controller */
index 96f3a133540dbafa06c83c73c77ba2877fb4a8fc..b96b543bf2f652e7a431af48a6807bb4271be4e6 100644 (file)
@@ -94,8 +94,8 @@ struct mhi_ep_buf_info {
  * @raise_irq: CB function for raising IRQ to the host
  * @alloc_map: CB function for allocating memory in endpoint for storing host context and mapping it
  * @unmap_free: CB function to unmap and free the allocated memory in endpoint for storing host context
- * @read_from_host: CB function for reading from host memory from endpoint
- * @write_to_host: CB function for writing to host memory from endpoint
+ * @read_sync: CB function for reading from host memory synchronously
+ * @write_sync: CB function for writing to host memory synchronously
  * @mhi_state: MHI Endpoint state
  * @max_chan: Maximum channels supported by the endpoint controller
  * @mru: MRU (Maximum Receive Unit) value of the endpoint controller
@@ -149,8 +149,8 @@ struct mhi_ep_cntrl {
                         void __iomem **virt, size_t size);
        void (*unmap_free)(struct mhi_ep_cntrl *mhi_cntrl, u64 pci_addr, phys_addr_t phys,
                           void __iomem *virt, size_t size);
-       int (*read_from_host)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
-       int (*write_to_host)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
+       int (*read_sync)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
+       int (*write_sync)(struct mhi_ep_cntrl *mhi_cntrl, struct mhi_ep_buf_info *buf_info);
 
        enum mhi_state mhi_state;