Skip to content

Commit ba8182d

Browse files
Dr. David Alan Gilbertakpm00
authored andcommitted
rapidio: remove unused functions
rio_request_dma() and rio_dma_prep_slave_sg() were added in 2012 by commit e42d98e ("rapidio: add DMA engine support for RIO data transfers") but never used. rio_find_mport() last use was removed in 2013 by commit 9edbc30 ("rapidio: update enumerator registration mechanism") rio_unregister_scan() was added in 2013 by commit a11650e ("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>
1 parent b7df1f2 commit ba8182d

File tree

3 files changed

+0
-110
lines changed

3 files changed

+0
-110
lines changed

drivers/rapidio/rio.c

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,19 +1774,6 @@ struct dma_chan *rio_request_mport_dma(struct rio_mport *mport)
17741774
}
17751775
EXPORT_SYMBOL_GPL(rio_request_mport_dma);
17761776

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-
17901777
/**
17911778
* rio_release_dma - release specified DMA channel
17921779
* @dchan: DMA channel to release
@@ -1834,56 +1821,8 @@ struct dma_async_tx_descriptor *rio_dma_prep_xfer(struct dma_chan *dchan,
18341821
}
18351822
EXPORT_SYMBOL_GPL(rio_dma_prep_xfer);
18361823

1837-
/**
1838-
* rio_dma_prep_slave_sg - RapidIO specific wrapper
1839-
* for device_prep_slave_sg callback defined by DMAENGINE.
1840-
* @rdev: RIO device control structure
1841-
* @dchan: DMA channel to configure
1842-
* @data: RIO specific data descriptor
1843-
* @direction: DMA data transfer direction (TO or FROM the device)
1844-
* @flags: dmaengine defined flags
1845-
*
1846-
* Initializes RapidIO capable DMA channel for the specified data transfer.
1847-
* Uses DMA channel private extension to pass information related to remote
1848-
* target RIO device.
1849-
*
1850-
* Returns: pointer to DMA transaction descriptor if successful,
1851-
* error-valued pointer or NULL if failed.
1852-
*/
1853-
struct dma_async_tx_descriptor *rio_dma_prep_slave_sg(struct rio_dev *rdev,
1854-
struct dma_chan *dchan, struct rio_dma_data *data,
1855-
enum dma_transfer_direction direction, unsigned long flags)
1856-
{
1857-
return rio_dma_prep_xfer(dchan, rdev->destid, data, direction, flags);
1858-
}
1859-
EXPORT_SYMBOL_GPL(rio_dma_prep_slave_sg);
1860-
18611824
#endif /* CONFIG_RAPIDIO_DMA_ENGINE */
18621825

1863-
/**
1864-
* rio_find_mport - find RIO mport by its ID
1865-
* @mport_id: number (ID) of mport device
1866-
*
1867-
* Given a RIO mport number, the desired mport is located
1868-
* in the global list of mports. If the mport is found, a pointer to its
1869-
* data structure is returned. If no mport is found, %NULL is returned.
1870-
*/
1871-
struct rio_mport *rio_find_mport(int mport_id)
1872-
{
1873-
struct rio_mport *port;
1874-
1875-
mutex_lock(&rio_mport_list_lock);
1876-
list_for_each_entry(port, &rio_mports, node) {
1877-
if (port->id == mport_id)
1878-
goto found;
1879-
}
1880-
port = NULL;
1881-
found:
1882-
mutex_unlock(&rio_mport_list_lock);
1883-
1884-
return port;
1885-
}
1886-
18871826
/**
18881827
* rio_register_scan - enumeration/discovery method registration interface
18891828
* @mport_id: mport device ID for which fabric scan routine has to be set
@@ -1961,48 +1900,6 @@ int rio_register_scan(int mport_id, struct rio_scan *scan_ops)
19611900
}
19621901
EXPORT_SYMBOL_GPL(rio_register_scan);
19631902

1964-
/**
1965-
* rio_unregister_scan - removes enumeration/discovery method from mport
1966-
* @mport_id: mport device ID for which fabric scan routine has to be
1967-
* unregistered (RIO_MPORT_ANY = apply to all mports that use
1968-
* the specified scan_ops)
1969-
* @scan_ops: enumeration/discovery operations structure
1970-
*
1971-
* Removes enumeration or discovery method assigned to the specified mport
1972-
* device. If RIO_MPORT_ANY is specified, removes the specified operations from
1973-
* all mports that have them attached.
1974-
*/
1975-
int rio_unregister_scan(int mport_id, struct rio_scan *scan_ops)
1976-
{
1977-
struct rio_mport *port;
1978-
struct rio_scan_node *scan;
1979-
1980-
pr_debug("RIO: %s for mport_id=%d\n", __func__, mport_id);
1981-
1982-
if (mport_id != RIO_MPORT_ANY && mport_id >= RIO_MAX_MPORTS)
1983-
return -EINVAL;
1984-
1985-
mutex_lock(&rio_mport_list_lock);
1986-
1987-
list_for_each_entry(port, &rio_mports, node)
1988-
if (port->id == mport_id ||
1989-
(mport_id == RIO_MPORT_ANY && port->nscan == scan_ops))
1990-
port->nscan = NULL;
1991-
1992-
list_for_each_entry(scan, &rio_scans, node) {
1993-
if (scan->mport_id == mport_id) {
1994-
list_del(&scan->node);
1995-
kfree(scan);
1996-
break;
1997-
}
1998-
}
1999-
2000-
mutex_unlock(&rio_mport_list_lock);
2001-
2002-
return 0;
2003-
}
2004-
EXPORT_SYMBOL_GPL(rio_unregister_scan);
2005-
20061903
/**
20071904
* rio_mport_scan - execute enumeration/discovery on the specified mport
20081905
* @mport_id: number (ID) of mport device

drivers/rapidio/rio.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ extern void rio_del_device(struct rio_dev *rdev, enum rio_device_state state);
4141
extern int rio_enable_rx_tx_port(struct rio_mport *port, int local, u16 destid,
4242
u8 hopcount, u8 port_num);
4343
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);
4544
extern void rio_attach_device(struct rio_dev *rdev);
46-
extern struct rio_mport *rio_find_mport(int mport_id);
4745
extern int rio_mport_scan(int mport_id);
4846

4947
/* Structures internal to the RIO core code */

include/linux/rio_drv.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,8 @@ struct rio_dev *rio_dev_get(struct rio_dev *);
391391
void rio_dev_put(struct rio_dev *);
392392

393393
#ifdef CONFIG_RAPIDIO_DMA_ENGINE
394-
extern struct dma_chan *rio_request_dma(struct rio_dev *rdev);
395394
extern struct dma_chan *rio_request_mport_dma(struct rio_mport *mport);
396395
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);
401396
extern struct dma_async_tx_descriptor *rio_dma_prep_xfer(
402397
struct dma_chan *dchan, u16 destid,
403398
struct rio_dma_data *data,

0 commit comments

Comments
 (0)