From patchwork Fri Sep 27 03:12:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 174572 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2926703ill; Thu, 26 Sep 2019 20:12:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyc8OR0dRNUXzLlY/E2o2STlSGFUMovYOWsFduIdIfHKU+gzbuVS43bcjOZdVfwjbrIgfXn X-Received: by 2002:a50:a666:: with SMTP id d93mr2186488edc.217.1569553962831; Thu, 26 Sep 2019 20:12:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569553962; cv=none; d=google.com; s=arc-20160816; b=oDz8QKUSR1j710F/GVQ2I1xLJ2BtL9/d7jjLizSEVgh83Z5VI2FU/aae5VP9HvPZut Mqq/TRjG3FCWisRN9uzLMUI9digin8WWXXIxj6W0PeD2plC1TW4FMJikEWkkfjXWZgNV nXXnIpWtR9/LA0wcyVkD3am+oETVJhjq1XY7avvxmbQuuD5ljAPiDIijh/ZiDiD70gwc SpeM0uGTyIr0lT2QEFvdgZW4aDLOJ9BVDBBSkruh84FaQ4Bx42PLkKUHBUaTnDHcAWSh x7Hhx8hUxvI+HXMYL+dH0hepmwyP4vUmqzz9tqb9fpuX/tBotiZja0rrIfSXNY0JwVbT atig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=IDR1u0tDazDoFj1oRmQ9KT0VVbtUGa9TuFv0cKouQkY=; b=qzdfLdjbL3HuFZXgTqyeU/NPQDNbFHt0greMIeK3U1wQkLz6qfcqLuiKG2fUEvySLy kpUoAe4Cn97PeR+vbgyawg0n26qOcaEyZgJ+wZEWxiPS1Bmgvmo5cx2GhmUtW8Goy6A4 efBItsny/N8K7KrXUGqsLhoTDeeXIL1aumni6zuhokWDc1Y2JOvQOQluFKw84ssLOdav eybiSGgSXhSrukeVQ0NyCyZAeg9kNOs01BhRyPcnv5WRXOBg0dv/rsvQo0L3BAlMrfyQ wlajr4WtBRsjoAwj/sCW1s5d22sQSMuoyyn31+rJASEU91/3bxCqPdRRuFZlGPG5ooLm imng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=P6EtdWzE; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si2034123ejf.53.2019.09.26.20.12.42; Thu, 26 Sep 2019 20:12:42 -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=@linaro.org header.s=google header.b=P6EtdWzE; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728978AbfI0DMi (ORCPT + 26 others); Thu, 26 Sep 2019 23:12:38 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:40053 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727796AbfI0DMi (ORCPT ); Thu, 26 Sep 2019 23:12:38 -0400 Received: by mail-pl1-f195.google.com with SMTP id d22so478206pll.7 for ; Thu, 26 Sep 2019 20:12:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=IDR1u0tDazDoFj1oRmQ9KT0VVbtUGa9TuFv0cKouQkY=; b=P6EtdWzEqrjcSWvJz9Q82B8ZrokpEFTk/HoxeaTU6JsOyMOYnMReWnaztjl3LhLGN6 f6qqI+TcRmSOYK86B3MQnrvFUrCwyPeO8brcTVvNWHlFcHV72z/itw6PSSdEwLncBo6D XsMZ3zVkZD49szd/mVC4kUBaQbaywFKfEBQgGWE8S45rN7YOt0/UX359vZXNI5xpo+Xq 9cqEbHKW5FeTBvCWD21chvkCESH5Ifdg4kkWRrq8S+bvzH5mCojGhPju1tzU+4pYjT3r Ndf0VRb6b6xVNa96Ydqu7kUq2mQ9a9JrqT+ROQH/DSSO6C0gUSzKZwQUDUejM8C07Rq7 VQpg== 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; bh=IDR1u0tDazDoFj1oRmQ9KT0VVbtUGa9TuFv0cKouQkY=; b=OXaQIqra/96KD2Z63x/NiQ1IkL2omzG0txEIBxRqnmxhCgbTZhVkGvh+49chQF2TJb tm+rXx5Q4gARywjmCxA279jQlrNAAzU09hYOl9SPIv0tqBP7gUr9P2z82IjdpbU6vcB6 NvenYuVvajNgfinv58W+OEWyOFR1uoEPpnBW49cm7GFwpIvmozvaL29DsbyDKGS0UNvq Y+h4MOUfr72kb75W0uFEKq97PzAi8T9vbJJ/t3HajcSp89ytvjV2jEvoh2XYYB+2T/6V 90Nt93JVYXKVdnfnZiWvMWeKLAEkzc1arPJMbjadqgLfj3GNiSk3JJqtN3zOlFhyo26+ m7sQ== X-Gm-Message-State: APjAAAWf0xMAYP3gU5jpixgImTuYi62jAW/sCqMhrERHfJvTIQhvTFGO 20ECqcVXnABJ3hXuMO1sx/PGnQ== X-Received: by 2002:a17:902:b787:: with SMTP id e7mr2180823pls.134.1569553956410; Thu, 26 Sep 2019 20:12:36 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id g24sm697965pfi.81.2019.09.26.20.12.32 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Sep 2019 20:12:35 -0700 (PDT) From: Baolin Wang To: srinivas.kandagatla@linaro.org Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, baolin.wang@linaro.org, freeman.liu@unisoc.com, linux-kernel@vger.kernel.org Subject: [PATCH] nvmem: sc27xx: Change to use devm_hwspin_lock_request_specific() to request one hwlock Date: Fri, 27 Sep 2019 11:12:19 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change to use devm_hwspin_lock_request_specific() to help to simplify the cleanup code for drivers requesting one hwlock. Thus we can remove the redundant sc27xx_efuse_remove() and platform_set_drvdata(). Signed-off-by: Baolin Wang --- drivers/nvmem/sc27xx-efuse.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) -- 1.7.9.5 diff --git a/drivers/nvmem/sc27xx-efuse.c b/drivers/nvmem/sc27xx-efuse.c index c6ee210..ab5e7e0 100644 --- a/drivers/nvmem/sc27xx-efuse.c +++ b/drivers/nvmem/sc27xx-efuse.c @@ -211,7 +211,7 @@ static int sc27xx_efuse_probe(struct platform_device *pdev) return ret; } - efuse->hwlock = hwspin_lock_request_specific(ret); + efuse->hwlock = devm_hwspin_lock_request_specific(&pdev->dev, ret); if (!efuse->hwlock) { dev_err(&pdev->dev, "failed to request hwspinlock\n"); return -ENXIO; @@ -219,7 +219,6 @@ static int sc27xx_efuse_probe(struct platform_device *pdev) mutex_init(&efuse->mutex); efuse->dev = &pdev->dev; - platform_set_drvdata(pdev, efuse); econfig.stride = 1; econfig.word_size = 1; @@ -232,21 +231,12 @@ static int sc27xx_efuse_probe(struct platform_device *pdev) nvmem = devm_nvmem_register(&pdev->dev, &econfig); if (IS_ERR(nvmem)) { dev_err(&pdev->dev, "failed to register nvmem config\n"); - hwspin_lock_free(efuse->hwlock); return PTR_ERR(nvmem); } return 0; } -static int sc27xx_efuse_remove(struct platform_device *pdev) -{ - struct sc27xx_efuse *efuse = platform_get_drvdata(pdev); - - hwspin_lock_free(efuse->hwlock); - return 0; -} - static const struct of_device_id sc27xx_efuse_of_match[] = { { .compatible = "sprd,sc2731-efuse" }, { } @@ -254,7 +244,6 @@ static int sc27xx_efuse_remove(struct platform_device *pdev) static struct platform_driver sc27xx_efuse_driver = { .probe = sc27xx_efuse_probe, - .remove = sc27xx_efuse_remove, .driver = { .name = "sc27xx-efuse", .of_match_table = sc27xx_efuse_of_match,