From patchwork Mon Sep 18 08:04:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoine Tenart X-Patchwork-Id: 9955719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 89D8F601E9 for ; Mon, 18 Sep 2017 08:39:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79C9B28BC6 for ; Mon, 18 Sep 2017 08:39:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E49B28BA6; Mon, 18 Sep 2017 08:39:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0EF5B28BA6 for ; Mon, 18 Sep 2017 08:39:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=AybpHKhGFTGuCVFSjSCppvgbxetFKyx1rDDdPJBBmXw=; b=Uh6 Ahp1JWeEEgW4uMyFbPg1kcI6AD1grmU0WTTYLntqZn5tdt44iKCMgeNNBGCCn5HNDZferflxucBCb Rwei8+W9bUmfks6x3f5z+gQr4JVPmwPZpfAxaZEpd10QfuMLYt+kawmfHLU9UX4ESo+3xfAAaAA66 4h9uQe3zPNmwSOEy3ZU4oih8cPjWt6O+6Cy2Z2M88t9IP1x7UjO+DSoD+aM5PwpoF+uvfmSsHAJPO bVFwfkxYkXTZyWEaN4jH8NdjVJ+f/6OWL/pFZong4GiIF64kazG1fiBxUqTCVCPVXgTc153Jhufxo UPHGT0RpiHHUfmoiANnv2YhmZjTT7Rw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dtraG-0000Ed-7P; Mon, 18 Sep 2017 08:39:16 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dtrNH-00006A-UT for linux-arm-kernel@bombadil.infradead.org; Mon, 18 Sep 2017 08:25:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4vdZEUNdNlh57oH1MeYOPCqdE4Zt7c1gUh4niKegSRY=; b=zeuwKIvLfMHt/GQJk1gHI8Mmm bCVzV2IQAY6EkQ0gh1fGZ/R8W0qmaAlUviVRi88+eyIF2QA4GfvSkLMdzKWPmr15y7RSmovVPoKdA R955we4Pa0aJ5TqK6TxlKtmJN+/xlal9tFZT8SzApoZHz9t2V3gFf1bDOr8A7g41bJjpjgdDxvTqn iZ6rJcdSpRObhsYp0zgEg14f+rVbh927+z/kgP08ltJ+mZ5ltS91YNGDA+7brSlM/G09wzUvoZ+WN 0eljjd9qCneEQiirzUMRbzZZty55IBcP6om4cq53kiM/i0mkf4bw2rhmXIme7fMsIEfp7aJRtyzby cp/vOVTZQ==; Received: from mail.free-electrons.com ([62.4.15.54]) by merlin.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dtr3T-0002bj-Gs for linux-arm-kernel@lists.infradead.org; Mon, 18 Sep 2017 08:05:24 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id 3760920A2E; Mon, 18 Sep 2017 10:05:02 +0200 (CEST) Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 0F6CF20872; Mon, 18 Sep 2017 10:05:02 +0200 (CEST) From: Antoine Tenart To: kishon@ti.com Subject: [PATCH 1/3] phy: mvebu-cp110-comphy: fix mux error check Date: Mon, 18 Sep 2017 10:04:20 +0200 Message-Id: <20170918080422.28972-1-antoine.tenart@free-electrons.com> X-Mailer: git-send-email 2.13.5 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thomas.petazzoni@free-electrons.com, Antoine Tenart , linux-kernel@vger.kernel.org, nadavh@marvell.com, miquel.raynal@free-electrons.com, gregory.clement@free-electrons.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The mux value is retrieved from the mvebu_comphy_get_mux() function which returns an int. In mvebu_comphy_power_on() this int is stored to a u32 and a check is made to ensure it's not negative. Which is wrong. This fixes it. Fixes: d0438bd6aa09 ("phy: add the mvebu cp110 comphy driver") Signed-off-by: Antoine Tenart --- drivers/phy/marvell/phy-mvebu-cp110-comphy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c index 73ebad6634a7..514a1a47e1fd 100644 --- a/drivers/phy/marvell/phy-mvebu-cp110-comphy.c +++ b/drivers/phy/marvell/phy-mvebu-cp110-comphy.c @@ -468,8 +468,8 @@ static int mvebu_comphy_power_on(struct phy *phy) { struct mvebu_comphy_lane *lane = phy_get_drvdata(phy); struct mvebu_comphy_priv *priv = lane->priv; - int ret; - u32 mux, val; + int ret, mux; + u32 val; mux = mvebu_comphy_get_mux(lane->id, lane->port, lane->mode); if (mux < 0)