From patchwork Fri Sep 27 08:27:43 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: 174607 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3180539ill; Fri, 27 Sep 2019 01:28:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUUpLFBZ0Fym1UMFVXGkE+OC3hAuG8Hi6WOPgBYc+oFX5nagT8nylovpWmAnIKdq4JjxfB X-Received: by 2002:aa7:d688:: with SMTP id d8mr3176570edr.156.1569572899137; Fri, 27 Sep 2019 01:28:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569572899; cv=none; d=google.com; s=arc-20160816; b=wdm+0wS7DhsM1WYGGcQSxhnZ0+8T78pDQ7dpG4VScNfmCI/goQGt9IuWW0oZY7SY5v AA9z23cRTq287MLCRJqNBTwZCNFS77ExpdBRwjqPZMRn9ItyHW0gQsA7JxwJ5I0VOhGV lp2R4Tr7DrVX9iK31iCAtoXRIy0nVVgeIYUeWa4i7ZpKq90PVl10Xy58slafBwmdvHH+ qr9CDdd5jchIHhgWuiglwPmep7l+xY7esvVQpp32kbBsLT+KZ/8P5OUUPsWrZGJSvo/S SkdEn6+CrjmO/zvfqaadbaXoHXnts+KiwELsXnaCU1gM7GiLdFJ2try8M7fiVZzcEI/7 PfQQ== 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=nZvAywOUGdc+nGEJgKwNfZF/qVh73K5ZWBaGt6yR3wY=; b=UH9B+D6439VHa2gZxrIJI0GTZ29oenU+l0v0Rxy33XPL9oQfPbj/MXCH2WNGpRCooS PoQDifWvxFh6FfyhgGlCHThqjf/KF0a+X7Jyf/M7PlBGwRGfdoK4JgeB00I22FqY4r1F Ph9JbVihL8oVDBLSP3D/lHvCbzPnjdc2cs/0/eQU3Ta8eLdYYM0LB7ikGsutO58op3pN JMne0Eo8030hW+XC/gx7RXIPIdIVcNuh8TTNgyqQ4CGGaQxNnPBwEaX0nhXVfKq7SorD 7JrSqjdTPVYwFtGtiDV5uKU7n2FN7iNPvna5A4mx1r9SA6ogBNC7AKDushst7cbLTvWX RSjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g9A2VhoK; 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 u12si1131867edi.326.2019.09.27.01.28.18; Fri, 27 Sep 2019 01:28:19 -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=g9A2VhoK; 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 S1727163AbfI0I2S (ORCPT + 26 others); Fri, 27 Sep 2019 04:28:18 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:45156 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726730AbfI0I2Q (ORCPT ); Fri, 27 Sep 2019 04:28:16 -0400 Received: by mail-pl1-f193.google.com with SMTP id u12so779222pls.12 for ; Fri, 27 Sep 2019 01:28:15 -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:in-reply-to:references :in-reply-to:references; bh=nZvAywOUGdc+nGEJgKwNfZF/qVh73K5ZWBaGt6yR3wY=; b=g9A2VhoKoQRJQ8A/yxKiLRnba6H4pummdVWULOO9J5NHWXt5KisX96YWWyo1QvzxPp UpeqQbf4GpP1ehd/+rQcixZniIXYm0qCyx8tAhvNGMt0HWYdpt458yK1U/fA4F/3DGHM MK7AS60vGn54vJKXzjidUoX6MaIA/acYx5Ya8Z92bH0isTldnqytXSrSDm9imHmGX8jh L3tAvsTKvYHO8gQ6Zz3FnkS5FHWMEDWed+eScwvqYi6KPhlzIpSrcK1RumZRNOyPp9FY TyCty9tp9SwH+sJMcYKdKFs67f6yoEWcBjY7w0R4WgDjpkljQ801OL58ghqXXr2jcebj mOEw== 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=nZvAywOUGdc+nGEJgKwNfZF/qVh73K5ZWBaGt6yR3wY=; b=XDDTuQyMIhB/QnBcE7UVHK9EL0+Tn15H+xiaHJsewRFZutSNlIwYne92Som0dr8u2a VslafjR+g7G9evet1GkGRqKbiaeu0cLNp2e1V2aWqy23+nRKPhDtVSiu+HgNmRvElwCW 3OXjDIIAvYCTPTX/lzaTzOgTNyQK9bHAPmoW4NV8DQc7a88UbQyfqp3i+vbrg523Sz/u gPBO3tAPtMTsoYplfnfVnd6SP40iO5HKLyIF5pj5aTq4/7sUGzLSA/jC+0Db4ABknDzl VbZ/ppItaaAOerIjkpXfKolhjvVHg+8h9Sd/XsKfKLZpV3ZOZO4k7FxrEV5o4F1uUncA agZA== X-Gm-Message-State: APjAAAXdg9xN4NcPTk4qM7blzVDrapsbKhu+NA/RBHUw+QrlKLfIqdUJ j9oK/GutcZhO+RXJgKz0yFn3cw== X-Received: by 2002:a17:902:b20a:: with SMTP id t10mr3218500plr.277.1569572895591; Fri, 27 Sep 2019 01:28:15 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id 6sm2043521pfa.162.2019.09.27.01.28.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Sep 2019 01:28:14 -0700 (PDT) From: Baolin Wang To: linus.walleij@linaro.org, ohad@wizery.com, bjorn.andersson@linaro.org Cc: baolin.wang@linaro.org, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] hwspinlock: u8500_hsem: Use devm_hwspin_lock_register() to register hwlock controller Date: Fri, 27 Sep 2019 16:27:43 +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/u8500_hsem.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) -- 1.7.9.5 Reviewed-by: Linus Walleij diff --git a/drivers/hwspinlock/u8500_hsem.c b/drivers/hwspinlock/u8500_hsem.c index 0e8d4ff..b31141a 100644 --- a/drivers/hwspinlock/u8500_hsem.c +++ b/drivers/hwspinlock/u8500_hsem.c @@ -119,8 +119,8 @@ static int u8500_hsem_probe(struct platform_device *pdev) /* no pm needed for HSem but required to comply with hwspilock core */ pm_runtime_enable(&pdev->dev); - ret = hwspin_lock_register(bank, &pdev->dev, &u8500_hwspinlock_ops, - pdata->base_id, num_locks); + ret = devm_hwspin_lock_register(&pdev->dev, bank, &u8500_hwspinlock_ops, + pdata->base_id, num_locks); if (ret) { pm_runtime_disable(&pdev->dev); return ret; @@ -133,17 +133,10 @@ static int u8500_hsem_remove(struct platform_device *pdev) { struct hwspinlock_device *bank = platform_get_drvdata(pdev); void __iomem *io_base = bank->lock[0].priv - HSEM_REGISTER_OFFSET; - int ret; /* clear all interrupts */ writel(0xFFFF, io_base + HSEM_ICRALL); - ret = hwspin_lock_unregister(bank); - if (ret) { - dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret); - return ret; - } - pm_runtime_disable(&pdev->dev); return 0;