Skip to content

Commit 681e383

Browse files
tudorldavem330
authored andcommitted
fsl/fman: add API to get the device behind a fman port
Add an API that retrieves the 'struct device' that the specified FMan port probed against. The new API will be used in a subsequent patch that corrects the DMA devices used by the dpaa_eth driver. Signed-off-by: Laurentiu Tudor <[email protected]> Signed-off-by: Madalin Bucur <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1076aae commit 681e383

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

drivers/net/ethernet/freescale/fman/fman_port.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,6 +1728,20 @@ u32 fman_port_get_qman_channel_id(struct fman_port *port)
17281728
}
17291729
EXPORT_SYMBOL(fman_port_get_qman_channel_id);
17301730

1731+
/**
1732+
* fman_port_get_device
1733+
* port: Pointer to the FMan port device
1734+
*
1735+
* Get the 'struct device' associated to the specified FMan port device
1736+
*
1737+
* Return: pointer to associated 'struct device'
1738+
*/
1739+
struct device *fman_port_get_device(struct fman_port *port)
1740+
{
1741+
return port->dev;
1742+
}
1743+
EXPORT_SYMBOL(fman_port_get_device);
1744+
17311745
int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset)
17321746
{
17331747
if (port->buffer_offsets.hash_result_offset == ILLEGAL_BASE)

drivers/net/ethernet/freescale/fman/fman_port.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,6 @@ int fman_port_get_tstamp(struct fman_port *port, const void *data, u64 *tstamp);
157157

158158
struct fman_port *fman_port_bind(struct device *dev);
159159

160+
struct device *fman_port_get_device(struct fman_port *port);
161+
160162
#endif /* __FMAN_PORT_H */

0 commit comments

Comments
 (0)