linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: laurentiu.tudor@nxp.com
To: netdev@vger.kernel.org, madalin.bucur@nxp.com,
	roy.pledge@nxp.com, camelia.groza@nxp.com, leoyang.li@nxp.com
Cc: davem@davemloft.net, iommu@lists.linux-foundation.org,
	linux-arm-kernel@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
	Laurentiu Tudor <laurentiu.tudor@nxp.com>
Subject: [PATCH v2 4/9] fsl/fman: add API to get the device behind a fman port
Date: Sat, 27 Apr 2019 10:10:26 +0300	[thread overview]
Message-ID: <20190427071031.6563-5-laurentiu.tudor@nxp.com> (raw)
In-Reply-To: <20190427071031.6563-1-laurentiu.tudor@nxp.com>

From: Laurentiu Tudor <laurentiu.tudor@nxp.com>

Add an API that retrieves the 'struct device' that the specified fman
port probed against. The new API will be used in a subsequent iommu
enablement related patch.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Acked-by: Madalin Bucur <madalin.bucur@nxp.com>
---
 drivers/net/ethernet/freescale/fman/fman_port.c | 14 ++++++++++++++
 drivers/net/ethernet/freescale/fman/fman_port.h |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fman/fman_port.c b/drivers/net/ethernet/freescale/fman/fman_port.c
index ee82ee1384eb..bd76c9730692 100644
--- a/drivers/net/ethernet/freescale/fman/fman_port.c
+++ b/drivers/net/ethernet/freescale/fman/fman_port.c
@@ -1728,6 +1728,20 @@ u32 fman_port_get_qman_channel_id(struct fman_port *port)
 }
 EXPORT_SYMBOL(fman_port_get_qman_channel_id);
 
+/**
+ * fman_port_get_device
+ * port:	Pointer to the FMan port device
+ *
+ * Get the 'struct device' associated to the specified FMan port device
+ *
+ * Return: pointer to associated 'struct device'
+ */
+struct device *fman_port_get_device(struct fman_port *port)
+{
+	return port->dev;
+}
+EXPORT_SYMBOL(fman_port_get_device);
+
 int fman_port_get_hash_result_offset(struct fman_port *port, u32 *offset)
 {
 	if (port->buffer_offsets.hash_result_offset == ILLEGAL_BASE)
diff --git a/drivers/net/ethernet/freescale/fman/fman_port.h b/drivers/net/ethernet/freescale/fman/fman_port.h
index 9dbb69f40121..82f12661a46d 100644
--- a/drivers/net/ethernet/freescale/fman/fman_port.h
+++ b/drivers/net/ethernet/freescale/fman/fman_port.h
@@ -157,4 +157,6 @@ int fman_port_get_tstamp(struct fman_port *port, const void *data, u64 *tstamp);
 
 struct fman_port *fman_port_bind(struct device *dev);
 
+struct device *fman_port_get_device(struct fman_port *port);
+
 #endif /* __FMAN_PORT_H */
-- 
2.17.1


  parent reply	other threads:[~2019-04-27  7:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-27  7:10 [PATCH v2 0/9] Prerequisites for NXP LS104xA SMMU enablement laurentiu.tudor
2019-04-27  7:10 ` [PATCH v2 1/9] soc/fsl/qman: fixup liodns only on ppc targets laurentiu.tudor
2019-05-01 20:08   ` Li Yang
2019-04-27  7:10 ` [PATCH v2 2/9] soc/fsl/qbman_portals: add APIs to retrieve the probing status laurentiu.tudor
2019-05-01 19:47   ` Li Yang
2019-04-27  7:10 ` [PATCH v2 3/9] fsl/fman: backup and restore ICID registers laurentiu.tudor
2019-04-27 16:18   ` David Miller
2019-04-27  7:10 ` laurentiu.tudor [this message]
2019-04-27  7:10 ` [PATCH v2 5/9] dpaa_eth: defer probing after qbman laurentiu.tudor
2019-04-27  7:10 ` [PATCH v2 6/9] dpaa_eth: base dma mappings on the fman rx port laurentiu.tudor
2019-04-27  7:10 ` [PATCH v2 7/9] dpaa_eth: fix iova handling for contiguous frames laurentiu.tudor
2019-04-27 16:46   ` Christoph Hellwig
2019-05-02  9:10     ` Laurentiu Tudor
2019-04-27  7:10 ` [PATCH v2 8/9] dpaa_eth: fix iova handling for sg frames laurentiu.tudor
2019-04-27  7:10 ` [PATCH v2 9/9] dpaa_eth: fix SG frame cleanup laurentiu.tudor
2019-04-27 17:10   ` Joakim Tjernlund
2019-05-02  9:05     ` Laurentiu Tudor
2019-05-02 10:36       ` Joakim Tjernlund
2019-05-02 12:58         ` Laurentiu Tudor
2019-05-02 13:03           ` Joakim Tjernlund

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190427071031.6563-5-laurentiu.tudor@nxp.com \
    --to=laurentiu.tudor@nxp.com \
    --cc=camelia.groza@nxp.com \
    --cc=davem@davemloft.net \
    --cc=iommu@lists.linux-foundation.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=roy.pledge@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).