Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rapidio: remove unused functions

rio_request_dma() and rio_dma_prep_slave_sg() were added in 2012 by commit
e42d98ebe7d7 ("rapidio: add DMA engine support for RIO data transfers")
but never used.

rio_find_mport() last use was removed in 2013 by commit 9edbc30b434f
("rapidio: update enumerator registration mechanism")

rio_unregister_scan() was added in 2013 by commit a11650e11093 ("rapidio:
make enumeration/discovery configurable") but never used.

Remove them.

Link: https://lkml.kernel.org/r/20250419203012.429787-3-linux@treblig.org
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Dr. David Alan Gilbert and committed by
Andrew Morton
ba8182d4 b7df1f25

-110
-103
drivers/rapidio/rio.c
··· 1775 1775 EXPORT_SYMBOL_GPL(rio_request_mport_dma); 1776 1776 1777 1777 /** 1778 - * rio_request_dma - request RapidIO capable DMA channel that supports 1779 - * specified target RapidIO device. 1780 - * @rdev: RIO device associated with DMA transfer 1781 - * 1782 - * Returns pointer to allocated DMA channel or NULL if failed. 1783 - */ 1784 - struct dma_chan *rio_request_dma(struct rio_dev *rdev) 1785 - { 1786 - return rio_request_mport_dma(rdev->net->hport); 1787 - } 1788 - EXPORT_SYMBOL_GPL(rio_request_dma); 1789 - 1790 - /** 1791 1778 * rio_release_dma - release specified DMA channel 1792 1779 * @dchan: DMA channel to release 1793 1780 */ ··· 1821 1834 } 1822 1835 EXPORT_SYMBOL_GPL(rio_dma_prep_xfer); 1823 1836 1824 - /** 1825 - * rio_dma_prep_slave_sg - RapidIO specific wrapper 1826 - * for device_prep_slave_sg callback defined by DMAENGINE. 1827 - * @rdev: RIO device control structure 1828 - * @dchan: DMA channel to configure 1829 - * @data: RIO specific data descriptor 1830 - * @direction: DMA data transfer direction (TO or FROM the device) 1831 - * @flags: dmaengine defined flags 1832 - * 1833 - * Initializes RapidIO capable DMA channel for the specified data transfer. 1834 - * Uses DMA channel private extension to pass information related to remote 1835 - * target RIO device. 1836 - * 1837 - * Returns: pointer to DMA transaction descriptor if successful, 1838 - * error-valued pointer or NULL if failed. 1839 - */ 1840 - struct dma_async_tx_descriptor *rio_dma_prep_slave_sg(struct rio_dev *rdev, 1841 - struct dma_chan *dchan, struct rio_dma_data *data, 1842 - enum dma_transfer_direction direction, unsigned long flags) 1843 - { 1844 - return rio_dma_prep_xfer(dchan, rdev->destid, data, direction, flags); 1845 - } 1846 - EXPORT_SYMBOL_GPL(rio_dma_prep_slave_sg); 1847 - 1848 1837 #endif /* CONFIG_RAPIDIO_DMA_ENGINE */ 1849 - 1850 - /** 1851 - * rio_find_mport - find RIO mport by its ID 1852 - * @mport_id: number (ID) of mport device 1853 - * 1854 - * Given a RIO mport number, the desired mport is located 1855 - * in the global list of mports. If the mport is found, a pointer to its 1856 - * data structure is returned. If no mport is found, %NULL is returned. 1857 - */ 1858 - struct rio_mport *rio_find_mport(int mport_id) 1859 - { 1860 - struct rio_mport *port; 1861 - 1862 - mutex_lock(&rio_mport_list_lock); 1863 - list_for_each_entry(port, &rio_mports, node) { 1864 - if (port->id == mport_id) 1865 - goto found; 1866 - } 1867 - port = NULL; 1868 - found: 1869 - mutex_unlock(&rio_mport_list_lock); 1870 - 1871 - return port; 1872 - } 1873 1838 1874 1839 /** 1875 1840 * rio_register_scan - enumeration/discovery method registration interface ··· 1899 1960 return rc; 1900 1961 } 1901 1962 EXPORT_SYMBOL_GPL(rio_register_scan); 1902 - 1903 - /** 1904 - * rio_unregister_scan - removes enumeration/discovery method from mport 1905 - * @mport_id: mport device ID for which fabric scan routine has to be 1906 - * unregistered (RIO_MPORT_ANY = apply to all mports that use 1907 - * the specified scan_ops) 1908 - * @scan_ops: enumeration/discovery operations structure 1909 - * 1910 - * Removes enumeration or discovery method assigned to the specified mport 1911 - * device. If RIO_MPORT_ANY is specified, removes the specified operations from 1912 - * all mports that have them attached. 1913 - */ 1914 - int rio_unregister_scan(int mport_id, struct rio_scan *scan_ops) 1915 - { 1916 - struct rio_mport *port; 1917 - struct rio_scan_node *scan; 1918 - 1919 - pr_debug("RIO: %s for mport_id=%d\n", __func__, mport_id); 1920 - 1921 - if (mport_id != RIO_MPORT_ANY && mport_id >= RIO_MAX_MPORTS) 1922 - return -EINVAL; 1923 - 1924 - mutex_lock(&rio_mport_list_lock); 1925 - 1926 - list_for_each_entry(port, &rio_mports, node) 1927 - if (port->id == mport_id || 1928 - (mport_id == RIO_MPORT_ANY && port->nscan == scan_ops)) 1929 - port->nscan = NULL; 1930 - 1931 - list_for_each_entry(scan, &rio_scans, node) { 1932 - if (scan->mport_id == mport_id) { 1933 - list_del(&scan->node); 1934 - kfree(scan); 1935 - break; 1936 - } 1937 - } 1938 - 1939 - mutex_unlock(&rio_mport_list_lock); 1940 - 1941 - return 0; 1942 - } 1943 - EXPORT_SYMBOL_GPL(rio_unregister_scan); 1944 1963 1945 1964 /** 1946 1965 * rio_mport_scan - execute enumeration/discovery on the specified mport
-2
drivers/rapidio/rio.h
··· 41 41 extern int rio_enable_rx_tx_port(struct rio_mport *port, int local, u16 destid, 42 42 u8 hopcount, u8 port_num); 43 43 extern int rio_register_scan(int mport_id, struct rio_scan *scan_ops); 44 - extern int rio_unregister_scan(int mport_id, struct rio_scan *scan_ops); 45 44 extern void rio_attach_device(struct rio_dev *rdev); 46 - extern struct rio_mport *rio_find_mport(int mport_id); 47 45 extern int rio_mport_scan(int mport_id); 48 46 49 47 /* Structures internal to the RIO core code */
-5
include/linux/rio_drv.h
··· 391 391 void rio_dev_put(struct rio_dev *); 392 392 393 393 #ifdef CONFIG_RAPIDIO_DMA_ENGINE 394 - extern struct dma_chan *rio_request_dma(struct rio_dev *rdev); 395 394 extern struct dma_chan *rio_request_mport_dma(struct rio_mport *mport); 396 395 extern void rio_release_dma(struct dma_chan *dchan); 397 - extern struct dma_async_tx_descriptor *rio_dma_prep_slave_sg( 398 - struct rio_dev *rdev, struct dma_chan *dchan, 399 - struct rio_dma_data *data, 400 - enum dma_transfer_direction direction, unsigned long flags); 401 396 extern struct dma_async_tx_descriptor *rio_dma_prep_xfer( 402 397 struct dma_chan *dchan, u16 destid, 403 398 struct rio_dma_data *data,