Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11044465ybi; Thu, 25 Jul 2019 09:03:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyyLRMHti4qMPVdq0pEoyXFfqNZOxRyF2Qj3fZWel+IMK2vVqfEQ/4jJsTiY8e/qoq4QWzd X-Received: by 2002:a63:2f44:: with SMTP id v65mr85236388pgv.185.1564070589063; Thu, 25 Jul 2019 09:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564070589; cv=none; d=google.com; s=arc-20160816; b=j8v9yGYzmQcWHrSw1Z49HTIGxL4mSqWSJvVAZYy43LmXRo5mIT0hhPnFSSlbLVuykk tRp4SNpAE3aNaJMQhrn3uqU1fo5Tmv8EaD7TzpmeNr9mdSQSmND47PYI9OvvKBv+lWwy 6BH9NNAuDCQd6m5uvfLdhELJjX6c+L5fr8SG2rEhIBkEna0grscRScTKJ9oNmxWsEZRy h+Aj1++onfkoHLg4W/k7nJlTU8wdmzVVfHAHXiss8P2009womr7gpB7gD2ti3fBu0yKo vrcOtFf4HfkeBzH1cg+F0VFGZ74ASZKG+14lOPZ7KsdUGqMj4BkK7meT7AQlFUgVUcwi jdiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=I7zuXq+B8emJm/vwCEOOJ6LOcGUENqYhRqQbLruFnYI=; b=lyjBesHoxKslu1AL77Mb9+EN1nmvVY50zAbmvImi8mZIGT66f62a/BoSMT45eUmIbT xGMKoyjz0GEiGxTlghhQPymVNOygt3sNELjp5BhymB7lyV8h/fCJ7th18hsm5SQfTo4F mH21e24i87lu9f0vviXerhtMysU+VS2Zh1KC72ex1Wez6NR8gKvzz2y5rMWxWvnaxX0f 752f3tSLMVxobAj1J71qqvPbct6AugOHnfCEO84eVZ1uG/55mPhNFmYTXiqDcB4nW3De k7y9aCCGNbcNrQoQ7q73tYFtdlW7HnSR+PF9nU/iP/ysp/wWUs1RGXZdXoVI3cwaW2ST ObrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="iG6/G3YJ"; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f12si19135966pfq.187.2019.07.25.09.02.53; Thu, 25 Jul 2019 09:03:09 -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=fail header.i=@gmail.com header.s=20161025 header.b="iG6/G3YJ"; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389923AbfGYIzG (ORCPT + 99 others); Thu, 25 Jul 2019 04:55:06 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34075 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388546AbfGYIzF (ORCPT ); Thu, 25 Jul 2019 04:55:05 -0400 Received: by mail-pf1-f195.google.com with SMTP id b13so22407253pfo.1; Thu, 25 Jul 2019 01:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=I7zuXq+B8emJm/vwCEOOJ6LOcGUENqYhRqQbLruFnYI=; b=iG6/G3YJLE4ZZGea2kup1qrO4DItBBydDovywo+tTg9ZRIZaHFUrYsuegRP7lJrc7k VZ4jAT1mjtpHJQePHzpgvOtTTBzRVPZ43OGnzNVa5buz/pFO/HmNBtICgAN93710KKZ5 f71WgNGqQGuZ3MURp6lOSgpJZjg9GcWvpv18G0vBuXv/emNyVFYXZ9yU222fp/PxOGtQ d0mb1NrQ/f7f+POT0jZRdPGrjNnrGFIJ915kXms5D9TWUR0QjpT/07T9cE9zfMiO+yxC 81+eWCF9RLYhVSX9FAwAoQ11nuIp93bpJn03UpE7/cnIOfa48GE4YaVAVdRCYJ9tn0rF qFkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=I7zuXq+B8emJm/vwCEOOJ6LOcGUENqYhRqQbLruFnYI=; b=G3Wlo0rEIujAn9Q8R92pDFM9QFdMGziXgXgpax8fuEBQaj2cRsNxRp5TFq57OF3wKm msn9xb20TvqOJQeSEQasO946eNjht5aZ8GtBOMemPBdmshrVgjiO0c/s1+cf23tih66Q fJabRUh8ojjuzX03ER/uQaADj9kHtuaa9JCe0XUnZ/aT53Y2dcrp3xkPzkM+KbX1C2ic jtBu1liRx/sHdO+wpuFkWfTYCi/PpaIsLqlG6xVrCiRpcG6SN4MkZq8wx9+8J7G4RnbY lpD1gTXeDxygh+eGkXQkxv/SS6EO+SGRpXinTxT4ju2u9D4PZ8dIHf8ANpiC6+1iiF09 nPXw== X-Gm-Message-State: APjAAAV5/eI7L+Gw4l5WFR97iKTYM6KYJt8gYSAD/J9MwBeoBSOJ4QD5 BaN4nv7MCtxtj4bOrzmYRc9N7JAAa+k= X-Received: by 2002:aa7:8b55:: with SMTP id i21mr15598222pfd.155.1564044904544; Thu, 25 Jul 2019 01:55:04 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id e11sm61474201pfm.35.2019.07.25.01.55.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 01:55:03 -0700 (PDT) From: Chuhong Yuan Cc: Patrick Havelange , William Breathitt Gray , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] counter/ftm-quaddec: Use device-managed registration API Date: Thu, 25 Jul 2019 16:54:58 +0800 Message-Id: <20190725085458.21838-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make use of devm_counter_register. Then we can remove redundant unregistration API usage to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/counter/ftm-quaddec.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/counter/ftm-quaddec.c b/drivers/counter/ftm-quaddec.c index 68a9b7393457..bccbca8681b6 100644 --- a/drivers/counter/ftm-quaddec.c +++ b/drivers/counter/ftm-quaddec.c @@ -317,7 +317,7 @@ static int ftm_quaddec_probe(struct platform_device *pdev) ftm_quaddec_init(ftm); - ret = counter_register(&ftm->counter); + ret = devm_counter_register(&pdev->dev, &ftm->counter); if (ret) ftm_quaddec_disable(ftm); @@ -328,8 +328,6 @@ static int ftm_quaddec_remove(struct platform_device *pdev) { struct ftm_quaddec *ftm = platform_get_drvdata(pdev); - counter_unregister(&ftm->counter); - ftm_quaddec_disable(ftm); return 0; -- 2.20.1