Received: by 10.223.185.116 with SMTP id b49csp5961054wrg; Wed, 7 Mar 2018 22:42:59 -0800 (PST) X-Google-Smtp-Source: AG47ELu5pC6kVVOxhvrtEmR+nAFLG9q1TWUv/Y8ExlC5y0r+GW/3Cx8b8qa52UZQnTAgMP4yPrub X-Received: by 10.98.245.18 with SMTP id n18mr24822203pfh.25.1520491379027; Wed, 07 Mar 2018 22:42:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520491378; cv=none; d=google.com; s=arc-20160816; b=ouETALL23zE3KzkJY+C6M8UpMdCAjF5OXhA1AOTEo7NqACwWBRQV3v2eTKCzR642Wx 4fSMdTIA/5EzVkqCV6ndlW7+O1OR0nPaVll3Mp3XOXxuJuM6dNLsfGXAeYq66udBWV+T lA4Do6qKiDKP8dhvDha5qfmyZEFXk0IXbHzsWvl+gRXfJ6n2hXncFBS1sjy/koGPwNsg nHtJw46TveCenCEPF5oWR0LD6Rw18xM0L2kvRbOKVVnhoC0vMVb0iICHrK/2VkbviQcb FrSynnjvh3Tks29Qz/UZUHFMQHTvRTPMUQH3I4d4Jop12JlsNk3gQwvWYYsmb3A6diDm y8KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=4AokKIr66tmXAwVEyJYDUBrmRZfS6IwstzeiGnlskqc=; b=CbAbVvi89dnguII2IGHPgoLNJhw9NAEIQJb5hSJBx0iXsq0vg94fh0TXzC1GjiMfOI ktKX0vxtZv48hNuG+0qlkLl2qz/DAwd458gbwGrcV+BDMJSqCP9W0tHFaU5GUYqi5t5e JRr9h3k52shL1hUFCExy3FnaO5suaJaKb6Yjibd0I358mGEDkEWgtg9ij7CKmdcdJK2U 9KyKdQPsiC7997kkkk0BB0oucp9RGbrcr8kvktNT8pP7mad0yx86f7fdVbk9ykFbftCa bdbhvXHsRHnjuCnpnDOC+bl/qV2lmKRyRMriwIWzs39uxXU5MxLKBbfg2hwiiVU1bb84 KosQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jYmdjRsx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p3-v6si14118842pld.545.2018.03.07.22.42.44; Wed, 07 Mar 2018 22:42:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=jYmdjRsx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965272AbeCHE7C (ORCPT + 99 others); Wed, 7 Mar 2018 23:59:02 -0500 Received: from mail-co1nam03on0132.outbound.protection.outlook.com ([104.47.40.132]:62208 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934966AbeCHE6z (ORCPT ); Wed, 7 Mar 2018 23:58:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4AokKIr66tmXAwVEyJYDUBrmRZfS6IwstzeiGnlskqc=; b=jYmdjRsxQISbRCkEqDLQh+I78Fa1s6FrtGPDnsovsqWPUzEGHv7L6+KF4m0qEX7hrlRTrfvCuZ7Mv5GFbkDaMQCDPwIlel2v/VN6tl8D/OcRe/C6cXZ9wJWjHNHolIu2g9eLxy6evm5wJjW61J8rU416TaefNMhsw+DcxLS0dqg= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0999.namprd21.prod.outlook.com (52.132.133.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.588.7; Thu, 8 Mar 2018 04:58:53 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0588.008; Thu, 8 Mar 2018 04:58:53 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Jerome Brunet , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 31/67] net: phy: meson-gxl: check phy_write return value Thread-Topic: [PATCH AUTOSEL for 4.14 31/67] net: phy: meson-gxl: check phy_write return value Thread-Index: AQHTtpn/0rpeOFkckkCFrTyhejy4jg== Date: Thu, 8 Mar 2018 04:57:45 +0000 Message-ID: <20180308045641.7814-31-alexander.levin@microsoft.com> References: <20180308045641.7814-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045641.7814-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0999;7:+ibYY1qKdkvRtCfMEDRHcRHryI94mcyuCBLzTZBkXcAEvZ9y2XSZZtEIYqvDzCqJpPKmWJePo6JBfRea+qVBmhmxk3JsIIKjyHJWFoyqHok8fkMNtkFyPA8a3xMO9JUil9uOd/shYDMsl0z/0qCe8Dk4e/Sp9GpO2pN34j73BbD/ElPoF1gv/WUyABqCYM4eqEtlAy6k0nIMqvRerfXDSdgONUjwpphhKVyy4102IrWZ+fbhaxHe4iQagPKrdiom;20:pKDNFZxV9hZy/+L3zGb0i2Q0ktqw0LuUgdFteJtqRLMlkPZhRXr3JjE0gyK7bWWhD0QGe0BGY5hWAheP53u/R0tAv6Hb/TAdHcIJbDWcnPsz14zCHyPRknHQlNaWj4WaswPoakYLt6K27qoDvOJsxkoWVdxu3UAuXTBXDL2kT58= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c1d9f7e9-04e2-4593-8efd-08d584b14a19 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0999; x-ms-traffictypediagnostic: DM5PR2101MB0999: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231220)(944501244)(52105095)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB0999;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0999; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39860400002)(39380400002)(376002)(396003)(346002)(189003)(199004)(72206003)(3846002)(106356001)(8676002)(6116002)(1076002)(6512007)(14454004)(81156014)(66066001)(2906002)(3660700001)(478600001)(10290500003)(8936002)(6486002)(305945005)(7736002)(36756003)(2900100001)(81166006)(4326008)(25786009)(6436002)(5250100002)(105586002)(54906003)(22452003)(76176011)(5660300001)(10090500001)(110136005)(316002)(6506007)(86362001)(575784001)(186003)(2950100002)(97736004)(3280700002)(102836004)(99286004)(107886003)(59450400001)(68736007)(86612001)(53936002)(26005)(6666003)(2501003)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0999;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 5EUMjFWl7AfYAHde/mfO1DiZDnIFiWlDdZZfs5k58pwusuz/X+X4/I6TuHS+2ugIXd5pxCuzX3lRpV3ifEALdEjZQYK39w3tkZetldTcSBMk/ybk9Cs1nIM9jry4rlpz04upV3DzN3A0NKOwGgl9GxzixYPb1GYSQs78909pRyGM9NxBItILH0l9EaQ98cGIhmWLTmKl+HcgAsyv/CupkmkZY0tSLBPWm6Z8uKMZUbiL8diRlZasVeKjIHUrgs/gbqGXban7fcUsR9Cue5Rw2RCVOWQ6TVBJIn5zodkKm7wrVoszWhwGqTorKo7bDiu5naGMDCzrKjYtvlXKjaZIIg== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1d9f7e9-04e2-4593-8efd-08d584b14a19 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:57:45.1263 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0999 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jerome Brunet [ Upstream commit 9042b46eda33ef5db3cdfc9e12b3c8cabb196141 ] Always check phy_write return values. Better to be safe than sorry Reviewed-by: Andrew Lunn Signed-off-by: Jerome Brunet Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/phy/meson-gxl.c | 50 ++++++++++++++++++++++++++++++++++-------= ---- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c index 1ea69b7585d9..7ddb709f69fc 100644 --- a/drivers/net/phy/meson-gxl.c +++ b/drivers/net/phy/meson-gxl.c @@ -25,27 +25,53 @@ =20 static int meson_gxl_config_init(struct phy_device *phydev) { + int ret; + /* Enable Analog and DSP register Bank access by */ - phy_write(phydev, 0x14, 0x0000); - phy_write(phydev, 0x14, 0x0400); - phy_write(phydev, 0x14, 0x0000); - phy_write(phydev, 0x14, 0x0400); + ret =3D phy_write(phydev, 0x14, 0x0000); + if (ret) + return ret; + ret =3D phy_write(phydev, 0x14, 0x0400); + if (ret) + return ret; + ret =3D phy_write(phydev, 0x14, 0x0000); + if (ret) + return ret; + ret =3D phy_write(phydev, 0x14, 0x0400); + if (ret) + return ret; =20 /* Write Analog register 23 */ - phy_write(phydev, 0x17, 0x8E0D); - phy_write(phydev, 0x14, 0x4417); + ret =3D phy_write(phydev, 0x17, 0x8E0D); + if (ret) + return ret; + ret =3D phy_write(phydev, 0x14, 0x4417); + if (ret) + return ret; =20 /* Enable fractional PLL */ - phy_write(phydev, 0x17, 0x0005); - phy_write(phydev, 0x14, 0x5C1B); + ret =3D phy_write(phydev, 0x17, 0x0005); + if (ret) + return ret; + ret =3D phy_write(phydev, 0x14, 0x5C1B); + if (ret) + return ret; =20 /* Program fraction FR_PLL_DIV1 */ - phy_write(phydev, 0x17, 0x029A); - phy_write(phydev, 0x14, 0x5C1D); + ret =3D phy_write(phydev, 0x17, 0x029A); + if (ret) + return ret; + ret =3D phy_write(phydev, 0x14, 0x5C1D); + if (ret) + return ret; =20 /* Program fraction FR_PLL_DIV1 */ - phy_write(phydev, 0x17, 0xAAAA); - phy_write(phydev, 0x14, 0x5C1C); + ret =3D phy_write(phydev, 0x17, 0xAAAA); + if (ret) + return ret; + ret =3D phy_write(phydev, 0x14, 0x5C1C); + if (ret) + return ret; =20 return 0; } --=20 2.14.1