From patchwork Fri Jun 1 09:04:55 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: 10442797 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 5E8F6602BD for ; Fri, 1 Jun 2018 09:06:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53FF627BA5 for ; Fri, 1 Jun 2018 09:06:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4937128C22; Fri, 1 Jun 2018 09:06:35 +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 E3D6827BA5 for ; Fri, 1 Jun 2018 09:06:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751327AbeFAJGU (ORCPT ); Fri, 1 Jun 2018 05:06:20 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:36376 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbeFAJF6 (ORCPT ); Fri, 1 Jun 2018 05:05:58 -0400 Received: by mail-pg0-f68.google.com with SMTP id m5-v6so6615529pgd.3 for ; Fri, 01 Jun 2018 02:05:58 -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=bUqL0owydwmpEzB7POGEHGlQmMuVk6A1vRmNM+SV2xLlHRMuwRa6qfowBD35jCwBi+ mU6/lV6fgOyMH7gh//IeLH/LkSDBXKPma1/xTZJ2jog3XDUfzSwJKnEUwrdD81yB9wjF L52quBLUnXyKFAmgCX9sLFTcitt8kVnqFjL+4= 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=JtV8zAT5UtUXAIIOX2b7oBnoReZT9nyfhkXkrVd40FeuCx1vtqmk/KLeYBKSw+WWmW IKrOb2pZsI6SpoIRJTG1Ps3jvU5AsywpwOh0hUf9akIZTLrQbOzvGFwQiYCx9KRxn1DO nExx1lvoR0kznkJpGIyuqEUGr6B1FTqNaQ0hDHNMGWMTMIOHj+qiDkihYP3ZC3lUYm+b Cb9V7e+Kj1a51tAcLJNHgAFsXHCMROV+C49wb4wRX/pF6w/1BroYsrw6G/FIpgxTVaS8 fn1DH+J8U6GcjHTiIDXJR1tFXxcjIW20F5dOLOjftnglbGy7CeBGRBeUd2YAM091rUyD zdPw== X-Gm-Message-State: ALKqPwcxFDKPT90TW53XY2KXOIXLf7U3t4bvLPZiCyLeGB/8hv5BI/Ds YbYw8IpMD04x+bJp/bDkwwu+6/d1f/A= X-Google-Smtp-Source: ADUXVKLVFDTBtvSlFiM7ZnxpqLLj9c3fdJHSDVmMKZmV6AhKEBmQg7pMJpQzYqcKDViKroS0RM0gFQ== X-Received: by 2002:a63:7a49:: with SMTP id j9-v6mr8199208pgn.353.1527843957857; Fri, 01 Jun 2018 02:05:57 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id a4-v6sm89505351pfj.19.2018.06.01.02.05.55 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 01 Jun 2018 02:05:57 -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 4/4] spi: sprd: Change to use devm_hwspin_lock_request_specific() Date: Fri, 1 Jun 2018 17:04:55 +0800 Message-Id: <7bfce450d511115159e38d860318c6bd2216808a.1527843425.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1be6adeb558fada77de79a40cd5ef7dc2719c945.1527843425.git.baolin.wang@linaro.org> References: <1be6adeb558fada77de79a40cd5ef7dc2719c945.1527843425.git.baolin.wang@linaro.org> In-Reply-To: <1be6adeb558fada77de79a40cd5ef7dc2719c945.1527843425.git.baolin.wang@linaro.org> References: <1be6adeb558fada77de79a40cd5ef7dc2719c945.1527843425.git.baolin.wang@linaro.org> 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 --- 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; }