aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/fsl-dpaa2
diff options
context:
space:
mode:
authorIoana Ciornei <ioana.ciornei@nxp.com>2020-07-14 16:34:30 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-15 16:22:36 +0200
commit3b9c7029a7d6ee0876c5481db11947d57792cdd5 (patch)
tree346fc757348c53246419b222e4e587fb447897b1 /drivers/staging/fsl-dpaa2
parentstaging: dpaa2-ethsw: disable switch ports are probe time (diff)
downloadlinux-dev-3b9c7029a7d6ee0876c5481db11947d57792cdd5.tar.xz
linux-dev-3b9c7029a7d6ee0876c5481db11947d57792cdd5.zip
staging: dpaa2-ethsw: store version information of the DPSW object
Store the major and minor versions of the DPSW object in the ethsw structure. This will be used in a subsequent patch to make sure some commands are only called on the appropriate version of object. Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Link: https://lore.kernel.org/r/20200714133431.17532-6-ioana.ciornei@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fsl-dpaa2')
-rw-r--r--drivers/staging/fsl-dpaa2/ethsw/ethsw.c16
-rw-r--r--drivers/staging/fsl-dpaa2/ethsw/ethsw.h1
2 files changed, 9 insertions, 8 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index f283ce195c1e..a8fc9bcf3b8a 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -1368,9 +1368,9 @@ static int ethsw_init(struct fsl_mc_device *sw_dev)
{
struct device *dev = &sw_dev->dev;
struct ethsw_core *ethsw = dev_get_drvdata(dev);
- u16 version_major, version_minor, i;
struct dpsw_stp_cfg stp_cfg;
int err;
+ u16 i;
ethsw->dev_id = sw_dev->obj_desc.id;
@@ -1388,20 +1388,20 @@ static int ethsw_init(struct fsl_mc_device *sw_dev)
}
err = dpsw_get_api_version(ethsw->mc_io, 0,
- &version_major,
- &version_minor);
+ &ethsw->major,
+ &ethsw->minor);
if (err) {
dev_err(dev, "dpsw_get_api_version err %d\n", err);
goto err_close;
}
/* Minimum supported DPSW version check */
- if (version_major < DPSW_MIN_VER_MAJOR ||
- (version_major == DPSW_MIN_VER_MAJOR &&
- version_minor < DPSW_MIN_VER_MINOR)) {
+ if (ethsw->major < DPSW_MIN_VER_MAJOR ||
+ (ethsw->major == DPSW_MIN_VER_MAJOR &&
+ ethsw->minor < DPSW_MIN_VER_MINOR)) {
dev_err(dev, "DPSW version %d:%d not supported. Use %d.%d or greater.\n",
- version_major,
- version_minor,
+ ethsw->major,
+ ethsw->minor,
DPSW_MIN_VER_MAJOR, DPSW_MIN_VER_MINOR);
err = -ENOTSUPP;
goto err_close;
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.h b/drivers/staging/fsl-dpaa2/ethsw/ethsw.h
index a0244f7d5003..0e520fd94dbc 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.h
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.h
@@ -61,6 +61,7 @@ struct ethsw_core {
struct fsl_mc_io *mc_io;
u16 dpsw_handle;
struct dpsw_attr sw_attr;
+ u16 major, minor;
int dev_id;
struct ethsw_port_priv **ports;