Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp243376ybl; Wed, 4 Dec 2019 01:56:42 -0800 (PST) X-Google-Smtp-Source: APXvYqw2qZxayzL5hHmqzBwiMRWXTFElzTOMQKb6NBotkB2d1v13GIHM0E0fYIZTCcri3NJh1anR X-Received: by 2002:aca:d4c1:: with SMTP id l184mr1837035oig.172.1575453401943; Wed, 04 Dec 2019 01:56:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575453401; cv=none; d=google.com; s=arc-20160816; b=Ibw2ad4uqkldMHS3Fb+pnbMC/qrhPaUKsf0hcEPns3UGUvYEtt7hqH5V/MHDrUigaq uQAv8IArYdy+OhbltNgYuHbOgAUxagVLy/dO9FptZsDp8U63BwBHmWC+oh4/nxfryJsK lKAc8TF1MhOf5lOMd3+DsTHuIpsWcBs4bYQcF9xRQDqRXVmOzp6fnMIqEPdDozKpVKaP A6dOQHvY15YZ+KgNgNGoYAiCfWb9Ljo6sr7Zk4WITwFfqVLOKmYHcuauWL5UnXPl6FUB Ne2/92b+N2JZ6/a6jRKlMABzFydauHd0DcSFzEkh82URtqU4asEpqj+gylt+HLOM8iRa oMbA== 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=lK0hzpi7lOKx/+vwwnIUmfL08coFZ79d+GQbKJpzbuw=; b=i7KAqeXZErS7vyqmJAneyYGW4XTdkrOtlypyyuuDbATOhl/qC3gPQY69h/C75Y5RgI DcfcaqZF4ZmFYL/SjwVOT5IcQAyjXx/EpIl1ka0X/f7ngvJhstaXSwmf+V+4ikQpIHhi d779Fi/RCOh9srqp/oEKd0SlsjlSSGEYGDBNOnQ82W+BmrIyuP52whHtKPXmtXx0cPXW K9VL3Go4n+jNlP80szBmITaKoFoVyOWznXouFACwAscUW8UeXBnWm4SyWkveBwB4O4z6 mGWzIQxPpj5yianXq1fAxNdq9Hljz+WIn1g1NR5ch3m6oRpwV2yskqR/x88JtZudLZb3 pXOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CqEjAqBZ; 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 m2si2667506otq.176.2019.12.04.01.56.29; Wed, 04 Dec 2019 01:56:41 -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=CqEjAqBZ; 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 S1727510AbfLDJy3 (ORCPT + 99 others); Wed, 4 Dec 2019 04:54:29 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:34730 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726632AbfLDJyZ (ORCPT ); Wed, 4 Dec 2019 04:54:25 -0500 Received: by mail-pg1-f195.google.com with SMTP id r11so3140563pgf.1; Wed, 04 Dec 2019 01:54:25 -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=lK0hzpi7lOKx/+vwwnIUmfL08coFZ79d+GQbKJpzbuw=; b=CqEjAqBZI2DYUBa0fTauRtHIY9p7Cyi3RlaTmg430JUBYj9ae2a90oUMiq04AsaKEb FJ/CvBZHMW0we9ND+ppTbh7a8jhOz8Ce6oowvzKhqXBTYcof1eDT4TYvV1G14vfnU+oF jWagkHpYSNVBn0HFZNE778WdHRIYPIlM+zUQScXvOKqTc0LHMnjd+rP6uT/B5i6b6Rhx vMlG2tNtuQ6idKDd4XOKTw2O42qnCff69KiICKuapSSsFi/5VciM+9Q1nVq5ui1yrKUg D9hy4Ir9b3g/x/F8rpLcOagASOykjRa8emkQGiy02pA7bc+cTS9mGUHt8pcCXl1ZztgS sydg== 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=lK0hzpi7lOKx/+vwwnIUmfL08coFZ79d+GQbKJpzbuw=; b=Ur8sqivKB/M90qi4hWl7An6s9a+ZJjXsqzTPh4dgyL5jXCrHxnGStG8dK0B9EjdggB jUJGE7+bEQjJhDhiyb4WdLMaaYcmvBJIzLX0uQQ86YnWoUmIfrid8mfkN+t7mu1m+Uh6 mFNhuZfZvDpaVwgiIejWOApDiabhNgwrhiLp33nKSRBUCVhkc98NaKN5FC1N0kAgM2XH 8j5UzDUIBKIj7aPUxJrCoRaUdvw16NcPquIQlyimQJsUsVmuyk132sIiKwOMx0Yvvt23 HoB4tMA4qZtbkLlwLcqXrhiLODASZtgOPlFC7WNmmLLvr4TFE6WI/KEngJ0U76aON23t NWAw== X-Gm-Message-State: APjAAAWwWj3TagBi0Oj3sKskmpyxLLk6nnytkfnhgdwfF4vrUDkR6kMQ 8/OxbRwPleWTtEJ0s6b6BKg= X-Received: by 2002:a63:7d6:: with SMTP id 205mr2613550pgh.131.1575453264820; Wed, 04 Dec 2019 01:54:24 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id k101sm5941687pjb.5.2019.12.04.01.54.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Dec 2019 01:54:24 -0800 (PST) From: Baolin Wang To: ohad@wizery.com, bjorn.andersson@linaro.org, baohua@kernel.org Cc: linux-arm-kernel@lists.infradead.org, baolin.wang7@gmail.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] hwspinlock: sirf: Use devm_hwspin_lock_register() to register hwlock controller Date: Wed, 4 Dec 2019 17:53:33 +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/sirf_hwspinlock.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/hwspinlock/sirf_hwspinlock.c b/drivers/hwspinlock/sirf_hwspinlock.c index d62462e..823d3c4 100644 --- a/drivers/hwspinlock/sirf_hwspinlock.c +++ b/drivers/hwspinlock/sirf_hwspinlock.c @@ -79,23 +79,9 @@ static int sirf_hwspinlock_probe(struct platform_device *pdev) platform_set_drvdata(pdev, hwspin); - return hwspin_lock_register(&hwspin->bank, &pdev->dev, - &sirf_hwspinlock_ops, 0, - HW_SPINLOCK_NUMBER); -} - -static int sirf_hwspinlock_remove(struct platform_device *pdev) -{ - struct sirf_hwspinlock *hwspin = platform_get_drvdata(pdev); - int ret; - - ret = hwspin_lock_unregister(&hwspin->bank); - if (ret) { - dev_err(&pdev->dev, "%s failed: %d\n", __func__, ret); - return ret; - } - - return 0; + return devm_hwspin_lock_register(&pdev->dev, &hwspin->bank, + &sirf_hwspinlock_ops, 0, + HW_SPINLOCK_NUMBER); } static const struct of_device_id sirf_hwpinlock_ids[] = { @@ -106,7 +92,6 @@ static int sirf_hwspinlock_remove(struct platform_device *pdev) static struct platform_driver sirf_hwspinlock_driver = { .probe = sirf_hwspinlock_probe, - .remove = sirf_hwspinlock_remove, .driver = { .name = "atlas7_hwspinlock", .of_match_table = of_match_ptr(sirf_hwpinlock_ids), -- 1.7.9.5