Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1757181ybh; Tue, 14 Jul 2020 06:37:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwukOBWHTCMy0GltpjTzFKImbcEXWoU/IuCTvG7xBFFJIauELJeIrnDnMgKcKIWa4Etp8s8 X-Received: by 2002:aa7:cf82:: with SMTP id z2mr4285801edx.15.1594733850494; Tue, 14 Jul 2020 06:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594733850; cv=none; d=google.com; s=arc-20160816; b=Q6ESrf2Wp1GsU9yEXu5amJT3dTcZDfACCbzLCF7KT0KQrZJFDhdtmQTjMUp5tlmChy 74qkyv7e9eA49rGW9UHf3xTjwXnnsyQh9k9GdLzFLfAPQLOLjlB7xUsdYTp5W3zdvssA stXWHF4/aJVNpC5c/uF01woCh5OAcTVWufyEfJiFUpqqy/gPVcmi2e0Jzz5ki042F+uv +TUUYPYi+JOzb8M5NfMmkNPuez2hIeYYZ2LcY0yQvKllNYXcNV2KF1mzv53Y2/Cv0Wqt llH56V3acn0U8cNDg/H9CPK7bNboina28WHtftccxRFaE1SmjH7+aYVifinRqwe9dC6I 4McQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=B/kVWttrUCOs/3ALsI01x1PnW2CpxlcF5mf6G+8mvtE=; b=ik+RXMekVm4+JiJXRmWU/D/6J2fCImw19gdbdNv3ZttnSR8Giw9923fvkv7M7zTQGo PW/QMfqmNNM4fwkFMdkk0mAfi2+EA/jeDniYXucjBZ8wRsoZR8RTzKSK9F8+cOE44VQv U8xLT2zYi26RegNU5ebovpw/MkzDTN3xgsA+AvS7ovCTYPQRvcUCDn8wp0DleHvL3X4s s0qCdmA1np1QdabkOvBkYwIgJw+fPQmvk0i3gRQNNSGfTXWfPSGYrWaJfqE9LkWuUTRz GQpNOOmoxqNlSO61yfUhOdnkRQ2NVnBrmMY3W7RtRCOyO17QjqSRy8+mwxivnZKyOXFc wTcA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si11164036edr.292.2020.07.14.06.37.06; Tue, 14 Jul 2020 06:37:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728652AbgGNNfY (ORCPT + 99 others); Tue, 14 Jul 2020 09:35:24 -0400 Received: from inva021.nxp.com ([92.121.34.21]:48278 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728417AbgGNNfS (ORCPT ); Tue, 14 Jul 2020 09:35:18 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A39ED201027; Tue, 14 Jul 2020 15:35:16 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 97BB22015E6; Tue, 14 Jul 2020 15:35:16 +0200 (CEST) Received: from fsr-ub1864-126.ea.freescale.net (fsr-ub1864-126.ea.freescale.net [10.171.82.212]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 618DA205A4; Tue, 14 Jul 2020 15:35:16 +0200 (CEST) From: Ioana Ciornei To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Ioana Ciornei Subject: [PATCH 5/6] staging: dpaa2-ethsw: store version information of the DPSW object Date: Tue, 14 Jul 2020 16:34:30 +0300 Message-Id: <20200714133431.17532-6-ioana.ciornei@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200714133431.17532-1-ioana.ciornei@nxp.com> References: <20200714133431.17532-1-ioana.ciornei@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 16 ++++++++-------- drivers/staging/fsl-dpaa2/ethsw/ethsw.h | 1 + 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); + ðsw->major, + ðsw->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; -- 2.25.1