Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp283903ybm; Wed, 22 May 2019 03:08:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcquMbkQKdoJW6100HmDcfuymabAF72CF9vasbyQHISVuM6Ng9bfvtCd4y1/XX7gBg1x0w X-Received: by 2002:a17:902:5066:: with SMTP id f35mr40595089plh.54.1558519688993; Wed, 22 May 2019 03:08:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558519688; cv=none; d=google.com; s=arc-20160816; b=n1PfGdeZYTATVyH6shK17++yrm3S3uXgkCWudf5DjUg2vHbsw7hQfpkW/h+AxOVHJN 9Y9tIu/k+JW1X/fE1WPlIh6QKm3uRWFThh8/naiDA7X6H8UuDxYl5C5Hi461KDgmZVN0 CNxAntaQCVoQOTw/ifopU5o4pC+02+AKDwBAw7Q1ICF3jcl54dDDJ0WS/9uZGArjLmBg eQb704nqJ5e3B3sEy2bpZPm46gKkLkSzo09WExJsYgfS26ItkkGLLJxGZ67s+TDCVaLl 5N8V7zw54dOz2xx0FuFa1Bcyj4t0dVIPqpLk63IgurO+UDBB0yBiRJ7vvWTGpS5sey1N tQHQ== 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 :content-id:content-language:accept-language:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=7UNfbEXsabz5kESBWA6ulrO4/whIWfxzgCO+ujPHTak=; b=y/hk3WE8LE+fFtOyaTPzzjqwZS15vS5L4CpJzYfpLB0SBuIZMrfccsalgkBpUY0ATJ h/RZf8OSZGFFFT9K8ICWOWp7YlmNQcob59ZIHwj9K6vGMA8QLHBCYAQknhWZ95HjWr9q TZp5rOVVEZFgcZzPvcUkZh2ZcnHXQ3+0NOU7jYi+67DTGpoNYlaHifEq8RLy3sejpfMC IDAPvmGK+2VMG937gfbDGHCuXAkQ1YTVocr8OLz0URPmPKOie7c1yGY562Uj7bbtIn0v Q8KDJ1WFEzHngGvVonRIfxUPuANUXROKbhfBGL74QIhh9zEWuSKKkVvd/1J5luxm/uWx NDwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-Synaptics-onmicrosoft-com header.b=UU6Bj4oX; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o7si24252266pgl.301.2019.05.22.03.07.52; Wed, 22 May 2019 03:08:08 -0700 (PDT) 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=@Synaptics.onmicrosoft.com header.s=selector1-Synaptics-onmicrosoft-com header.b=UU6Bj4oX; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729179AbfEVKFM (ORCPT + 99 others); Wed, 22 May 2019 06:05:12 -0400 Received: from mail-eopbgr810057.outbound.protection.outlook.com ([40.107.81.57]:36016 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728424AbfEVKFL (ORCPT ); Wed, 22 May 2019 06:05:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector1-Synaptics-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7UNfbEXsabz5kESBWA6ulrO4/whIWfxzgCO+ujPHTak=; b=UU6Bj4oXvxfmuDrfOF0dkNxLjZ1ma41SH9MEIjyQPcVSN+hMKrZXHKl4NVUMq4NuHYg9+orRs6Ur6NNsMY22GOsScgRUiWgPYJ3naKkm8S9zP/f5zvb9DxUyp/3/1lPHVPXLGWPOqTCb5AySSJKGCQ6rhIgSrt5JnCFD2VxeBLk= Received: from BYAPR03MB4773.namprd03.prod.outlook.com (20.179.92.152) by BYAPR03MB4152.namprd03.prod.outlook.com (20.177.184.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.17; Wed, 22 May 2019 10:05:09 +0000 Received: from BYAPR03MB4773.namprd03.prod.outlook.com ([fe80::e484:f15c:c415:5ff9]) by BYAPR03MB4773.namprd03.prod.outlook.com ([fe80::e484:f15c:c415:5ff9%7]) with mapi id 15.20.1900.020; Wed, 22 May 2019 10:05:09 +0000 From: Jisheng Zhang To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" CC: "netdev@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: [PATCH] net: stmmac: fix reset gpio free missing Thread-Topic: [PATCH] net: stmmac: fix reset gpio free missing Thread-Index: AQHVEIXW1Q99JUn5Pke19mHCbWn03A== Date: Wed, 22 May 2019 10:05:09 +0000 Message-ID: <20190522175558.59b21673@xhacker.debian> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [124.74.246.114] x-clientproxiedby: TYAPR01CA0232.jpnprd01.prod.outlook.com (2603:1096:404:11e::28) To BYAPR03MB4773.namprd03.prod.outlook.com (2603:10b6:a03:134::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 51926e20-f253-483b-8a7a-08d6de9cf8bc x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020);SRVR:BYAPR03MB4152; x-ms-traffictypediagnostic: BYAPR03MB4152: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-forefront-prvs: 0045236D47 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(136003)(39860400002)(346002)(396003)(376002)(199004)(189003)(53936002)(14454004)(72206003)(6506007)(486006)(81166006)(71190400001)(71200400001)(6512007)(9686003)(386003)(8676002)(81156014)(478600001)(476003)(8936002)(110136005)(50226002)(6116002)(99286004)(25786009)(54906003)(6486002)(68736007)(6436002)(52116002)(102836004)(4326008)(3846002)(66066001)(66556008)(64756008)(66446008)(256004)(66946007)(66476007)(316002)(14444005)(305945005)(7736002)(186003)(1076003)(86362001)(5660300002)(73956011)(26005)(2906002)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR03MB4152;H:BYAPR03MB4773.namprd03.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:0;MX:1; received-spf: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: TEVoJoHFTV8reiVFD+srtEOlRMGGPxghghCLGyUSvtPOZeKJBAEzra+TLOtVYgTx6yvuJXrRgXfLhHwyEMkgjYxpwK2y7JyCEoNpxzbRBt9dCWRpzDpV8spiDbUt+9xoTdavlO1fia2bcwrEdbe3uuv0BifnWWqp6QxFnjHdCQvRM9BRCQ143FKjXhyai3L6XfxGvhdVkmSjI27Xhtfg/DcTq1aV8Xg6Rdpir2wshbMG/scX3kgTxvhUVtMqCBxh70WpIghSsipa5jSBhbrEjYUmbNWRVcSe+310iwVWWK6V6a0eI/RdxIaHet47WP6Cqc4D7nXXQiN0n+g2zZeW2FH9Yb6oqA7Hlz+9YYceVoGdG++TqjiONLvU4sXpYVHO/iunMYw2mKb5aNkItN1sX3FMfRIBFmFSwP61owlxV1I= Content-Type: text/plain; charset="us-ascii" Content-ID: <95BC64B905AAEB45B689662B446B9877@namprd03.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51926e20-f253-483b-8a7a-08d6de9cf8bc X-MS-Exchange-CrossTenant-originalarrivaltime: 22 May 2019 10:05:09.3700 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR03MB4152 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 984203ceff27 ("net: stmmac: mdio: remove reset gpio free") removed the reset gpio free, when the driver is unbinded or rmmod, we miss the gpio free. This patch uses managed API to request the reset gpio, so that the gpio could be freed properly. Signed-off-by: Jisheng Zhang Fixes: 984203ceff27 ("net: stmmac: mdio: remove reset gpio free") --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/ne= t/ethernet/stmicro/stmmac/stmmac_mdio.c index bdd351597b55..093a223fe408 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -267,7 +267,8 @@ int stmmac_mdio_reset(struct mii_bus *bus) of_property_read_u32_array(np, "snps,reset-delays-us", data->delays, 3); =20 - if (gpio_request(data->reset_gpio, "mdio-reset")) + if (devm_gpio_request(priv->device, data->reset_gpio, + "mdio-reset")) return 0; } =20 --=20 2.20.1