Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp220500ybl; Wed, 4 Dec 2019 01:24:35 -0800 (PST) X-Google-Smtp-Source: APXvYqwSU0FF6TGj5vDRihgv4k9PFYgrXj4b78mkw+b3atp3csb0sTWlRywglqo3bGW2OjWWWZba X-Received: by 2002:a9d:22a8:: with SMTP id y37mr1654236ota.359.1575451474924; Wed, 04 Dec 2019 01:24:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575451474; cv=none; d=google.com; s=arc-20160816; b=0PtHlXFtRchXls4x/MaIMSKG+obA4Z04a6BYxTS88Qx/reSMOTrNX4WR7r42LZYIjH N4Q1cRe3BMyYf1oGipTp3zD4+CzWtozTefyPTpnyPiWdNqnZQuWL5caM9ntC/r+TQlzF 9x3HkQH2VVvPlx/V+CB5k84zUhtGZWoY5dwK5rhOylOTj/N70m+y7tiHsMdIOfp5QA4o McbOm8MRO5I4DOWAUBDPOCJyEVQrt8TZrQ1L4Xh2m6AaBEwBCKYtzRUM3CHIWnRdquEW ujomTRyXue9yTKND4Tajw9eUrj75Oz2CS6l4hwJs/MO8TnF3xS6YBTC5pUbH26iyreyg 17PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=hZU5YxHkU3BPXm/EGoWnc2P2DRdz8maIfOi1+S2ITKQ=; b=NZ3CHgwS/ZFaGGyWHfvjO75C2HH/6Vk+ecsjbMZtY13nO8GlIPn/C/ESANkBO3nUT/ LebWO2y8msR1dQs9Z/21ab3ESWO+CU8HfRSZE7ZNvM1Gvy3r25kFf27KVzTgjpZ0OIGz R4G7Jc6ftRKv+/Xi1JlXU4DtGbTmqsYYH0w3okKky/IXZaxrHF6+0AEA7fsSRqCylNdv gdQJlIUEBC4zAJh4REfdDdd5auvPaoywH8OT2ALZUZCrDmJaEMVS1FmO0s3apkZ6k/dt j6S7Z1UPbBFOktv4n+MpsagCkrVVbruiKR/CrBiCAAcDHAwn+SbZFdCt4PRLifEbzr5g JXWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SJQU3xhD; 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=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 e192si3015401oib.82.2019.12.04.01.24.20; Wed, 04 Dec 2019 01:24:34 -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=@gmail.com header.s=20161025 header.b=SJQU3xhD; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727428AbfLDJWp (ORCPT + 99 others); Wed, 4 Dec 2019 04:22:45 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:41706 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725922AbfLDJWn (ORCPT ); Wed, 4 Dec 2019 04:22:43 -0500 Received: by mail-pl1-f196.google.com with SMTP id bd4so2917975plb.8; Wed, 04 Dec 2019 01:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=hZU5YxHkU3BPXm/EGoWnc2P2DRdz8maIfOi1+S2ITKQ=; b=SJQU3xhDgVQLlqA2PNtmG0PvjtPCUUFyIjwfkUQwJg5y6Fl0apVSgQohqruxl80yaA NacX44nKHdGBRWHkNNaneKAV4PnO+SJTAafIId/KbpgyqXo80LHYLyXBIw63Yr7x+gHK HD1IQot5k1EHAs8UY1vJJHSEbmazKaoWAvOwd7ukxsb+HUfx+Ou1ZggyA13Z9dO07PRy B2hGCqKEjrQ4Gxwsey6NMhd33mkrPBZUsIhFJMYatvKVpescHhkzXJLJq4Sw55z8vgEL CDNTul6c6XPKAzzstA7BfEMYZD1QPZSeFagu620532gYaqEg9tfFvVCZb2Ty07wSAhVN ySTw== 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:in-reply-to :references:in-reply-to:references; bh=hZU5YxHkU3BPXm/EGoWnc2P2DRdz8maIfOi1+S2ITKQ=; b=ivP1dZRfGmDxnhoTg6p7dJeLygml8ECqLneeZWdWMX5yOJFp+O1qJaQaXmSJmGAKXL Ie2ZhBae7m+ClSU232KG2PJAM9t+x8tH4aojrSwlowBfLZkvQ9pOw6xpVQpt2WD7d9c1 1bqUrGx+kRi/hfawW1EuTIXWyPTN/zHUgciSFBX0zjlCJ/Y5OaqugkuVoYLAOn40f24w 36Uaq4slMJVOJG0gbxjX0zdLigBfBNyyDpkr8NFUtJAwNuQlxKpfc/ueGyu/4Ss8H59I cQX2upS1wijn+LD1QhnHHpxaNqKkbjPLAcO+KvVeTddFA804oh1ryd9V6K8yGy6CRnXM oaYw== X-Gm-Message-State: APjAAAUfnZhte2wan2T/q/ESFMjuh0Ae7Mc7jprUBLdU3AesP1YVzQAx wfq3X0oV4YXEjRNfr7hxEWY= X-Received: by 2002:a17:902:968b:: with SMTP id n11mr125690plp.120.1575451362767; Wed, 04 Dec 2019 01:22:42 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id k21sm6482914pgt.22.2019.12.04.01.22.40 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Dec 2019 01:22:42 -0800 (PST) From: Baolin Wang To: agross@kernel.org, ohad@wizery.com, bjorn.andersson@linaro.org Cc: baolin.wang7@gmail.com, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] hwspinlock: qcom: Use devm_hwspin_lock_register() to register hwlock controller Date: Wed, 4 Dec 2019 17:21:57 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use devm_hwspin_lock_register() to register the hwlock controller instead of unregistering the hwlock controller explicitly when removing the device. Signed-off-by: Baolin Wang --- drivers/hwspinlock/qcom_hwspinlock.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/hwspinlock/qcom_hwspinlock.c b/drivers/hwspinlock/qcom_hwspinlock.c index 5a736b0..f0da544 100644 --- a/drivers/hwspinlock/qcom_hwspinlock.c +++ b/drivers/hwspinlock/qcom_hwspinlock.c @@ -121,27 +121,12 @@ static int qcom_hwspinlock_probe(struct platform_device *pdev) regmap, field); } - return hwspin_lock_register(bank, &pdev->dev, &qcom_hwspinlock_ops, - 0, QCOM_MUTEX_NUM_LOCKS); -} - -static int qcom_hwspinlock_remove(struct platform_device *pdev) -{ - struct hwspinlock_device *bank = platform_get_drvdata(pdev); - int ret; - - ret = hwspin_lock_unregister(bank); - if (ret) { - dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret); - return ret; - } - - return 0; + return devm_hwspin_lock_register(&pdev->dev, bank, &qcom_hwspinlock_ops, + 0, QCOM_MUTEX_NUM_LOCKS); } static struct platform_driver qcom_hwspinlock_driver = { .probe = qcom_hwspinlock_probe, - .remove = qcom_hwspinlock_remove, .driver = { .name = "qcom_hwspinlock", .of_match_table = qcom_hwspinlock_of_match, -- 1.7.9.5