From patchwork Fri Jun 22 08:09:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10481483 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4911560230 for ; Fri, 22 Jun 2018 08:10:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CAAC28E69 for ; Fri, 22 Jun 2018 08:10:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3148E28E74; Fri, 22 Jun 2018 08:10:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAE3928E69 for ; Fri, 22 Jun 2018 08:10:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751086AbeFVIKT (ORCPT ); Fri, 22 Jun 2018 04:10:19 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:45878 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754340AbeFVIKO (ORCPT ); Fri, 22 Jun 2018 04:10:14 -0400 Received: by mail-pf0-f193.google.com with SMTP id a22-v6so2833391pfo.12 for ; Fri, 22 Jun 2018 01:10:14 -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=y6rwY3jFptgeXlF1nA+iIjbA4Z16sjg0bDMz2V84xl4=; b=kqLbuKHW/+VNUrQYSiHOPno0CbY7pYXtYPCLda0MHAVsKgMwbbqOzL8820VxtCZPQT NURCutWbp1fdESZz1H1QyYckGS2Yaqil24aAhMzAban4tAuH3A/ZYAFloAMg1mw6kMg+ skmpvY6VCP/bR6rfDvlPz7iPfdpnSTJ0SCRbE= 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=y6rwY3jFptgeXlF1nA+iIjbA4Z16sjg0bDMz2V84xl4=; b=q6VdJiJVB8ISQwBmrqBdGvkX2hJq7a++rOlqD8JqNg8TJ/VKT1dTMptaYKO1K7yj3E j8JDfbaW3qI4OJyIVjEuag/bul9uwl9vejLkFURUigQIa9/02Xg4yUfr4Fg9uV0yi3LD FrKsqgRM3XbFiKeYT8fJ4fiPy2NrQDNSJwsyTb5K/iasUS48+WNAkRKsf0JDQ/+7gzpR V+R9ClFxm51ds1Zrd0wd+H140XDoYqVx99pTILBb9Sy4uZ/2kSNP+AQC2/4wqoNEIuRF 6xu+5pLuEaTcQkJ2A9B8uGKyqagqX/JXAwb6FZA2KslGNh/sHkPgdP10sqTnCzXb3MaB Vy5A== X-Gm-Message-State: APt69E2kkI1QdgXWKrKVlj1ayGTFRlu02AveED96H2O7ucv803WQjtfd zWW4pkjdO/EJExbxH2x9HJgiFg== X-Google-Smtp-Source: ADUXVKKvEyXNuTHzTU6Jw8b3Rn+PLh/JWLMib5LJqPhLWqXFG0o218fgv5sFfR6ynjddqnDKBHlavg== X-Received: by 2002:a65:62cd:: with SMTP id m13-v6mr501456pgv.207.1529655014243; Fri, 22 Jun 2018 01:10:14 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id i65-v6sm22656131pfd.17.2018.06.22.01.10.11 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jun 2018 01:10:13 -0700 (PDT) From: Baolin Wang To: ohad@wizery.com, bjorn.andersson@linaro.org, broonie@kernel.org Cc: baolin.wang@linaro.org, linux-spi@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/8] spi: sprd: Change to use devm_hwspin_lock_request_specific() Date: Fri, 22 Jun 2018 16:09:05 +0800 Message-Id: <1662400fb204bbbe9a36edf580ea267079a2a02e.1529654288.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Change to use devm_hwspin_lock_request_specific() instead of freeing the hwlock explicitly when unbound the device. Signed-off-by: Baolin Wang Acked-by: Mark Brown --- drivers/spi/spi-sprd-adi.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index d8d5e2f..6fb5c0c 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -465,7 +465,7 @@ static int sprd_adi_probe(struct platform_device *pdev) goto put_ctlr; } - sadi->hwlock = hwspin_lock_request_specific(ret); + sadi->hwlock = devm_hwspin_lock_request_specific(&pdev->dev, ret); if (!sadi->hwlock) { ret = -ENXIO; goto put_ctlr; @@ -483,7 +483,7 @@ static int sprd_adi_probe(struct platform_device *pdev) ret = devm_spi_register_controller(&pdev->dev, ctlr); if (ret) { dev_err(&pdev->dev, "failed to register SPI controller\n"); - goto free_hwlock; + goto put_ctlr; } sadi->restart_handler.notifier_call = sprd_adi_restart_handler; @@ -491,13 +491,11 @@ static int sprd_adi_probe(struct platform_device *pdev) ret = register_restart_handler(&sadi->restart_handler); if (ret) { dev_err(&pdev->dev, "can not register restart handler\n"); - goto free_hwlock; + goto put_ctlr; } return 0; -free_hwlock: - hwspin_lock_free(sadi->hwlock); put_ctlr: spi_controller_put(ctlr); return ret; @@ -509,7 +507,6 @@ static int sprd_adi_remove(struct platform_device *pdev) struct sprd_adi *sadi = spi_controller_get_devdata(ctlr); unregister_restart_handler(&sadi->restart_handler); - hwspin_lock_free(sadi->hwlock); return 0; }