1 From 975717f04388a052cab9d3c3b6828d065372b82a Mon Sep 17 00:00:00 2001
2 From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
3 Date: Tue, 3 Apr 2018 17:11:07 +0300
4 Subject: [PATCH] fsl/fman: add API to get the device behind a fman port
6 Add an API that retrieves the 'struct device' that the specified fman
7 port probed against. The new API will be used in a subsequent iommu
8 enablement related patch.
10 Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
11 Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
13 drivers/net/ethernet/freescale/fman/fman_port.c | 14 ++++++++++++++
14 drivers/net/ethernet/freescale/fman/fman_port.h | 2 ++
15 2 files changed, 16 insertions(+)
17 --- a/drivers/net/ethernet/freescale/fman/fman_port.c
18 +++ b/drivers/net/ethernet/freescale/fman/fman_port.c
19 @@ -1728,6 +1728,20 @@ u32 fman_port_get_qman_channel_id(struct
21 EXPORT_SYMBOL(fman_port_get_qman_channel_id);
24 + * fman_port_get_device
25 + * port: Pointer to the FMan port device
27 + * Get the 'struct device' associated to the specified FMan port device
29 + * Return: pointer to associated 'struct device'
31 +struct device *fman_port_get_device(struct fman_port *port)
35 +EXPORT_SYMBOL(fman_port_get_device);
37 int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset)
39 if (port->buffer_offsets.hash_result_offset == ILLEGAL_BASE)
40 --- a/drivers/net/ethernet/freescale/fman/fman_port.h
41 +++ b/drivers/net/ethernet/freescale/fman/fman_port.h
42 @@ -157,4 +157,6 @@ int fman_port_get_tstamp(struct fman_por
44 struct fman_port *fman_port_bind(struct device *dev);
46 +struct device *fman_port_get_device(struct fman_port *port);
48 #endif /* __FMAN_PORT_H */