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: 139583 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp580750lji; Fri, 22 Jun 2018 01:10:20 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI3jaJ3fpRb+jASBZWpy8tyDSeCV/Vio32GJQ+bLD22ciCtLGf9uVHj3uAKF28IBmPAFm1Z X-Received: by 2002:a62:808f:: with SMTP id j137-v6mr640784pfd.91.1529655020371; Fri, 22 Jun 2018 01:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529655020; cv=none; d=google.com; s=arc-20160816; b=dZDu30+dlxeZhiYbdbC1Yk2k0VqL0RQogOLpNAzE3SUhHDjE+IZ8g7U5SmQwp684tV 0ATvDQwVuOpIKL3EyB847o/k5EXo/MvdHYVZsuGBcfNOSAbqZJ1VW4Y3wVF/8lMxqgcg +d/BHv6dGJ58lNV+6NoYIeF/W888pLceMHpOYad2aWj9oFUL6+wn5cPDTJ10Udu8CjFW OH1LAUDrIQds9ZzzyDtynrvaxT15Dn5wUwidaVYyAHJT4jp6cApR6QgS60JwCY4cXS1t Roiwvy8bDeMx7X4jaP1ELwDL1hNLKAORkjtpMRN6H7oHosiU9OK9JsWn8TDznojnD333 8JFQ== 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 :arc-authentication-results; bh=OtaJ4V/8jDqUsSCCtDtLkrWulFPxrnjYWzsXpS/O6sc=; b=bD9/fys6EKyKo0kU7/pttvbMsOkOdc74EVZzyaAkpY66eEN10346C2TUWWjA7Lwfwn QbX9fTaar44RennLXV35/e1MvUiU3w3mwxkMKIIml6IvcqI3Q/yMNBxGENCVQ/sOsWFy ZOa1A2gCNmsdd5V/jcvZXd3eZnfWD/zCH2k6zz04NLqNRkf+7Zsg8A1YU/nslaz/BPbZ 95OrdvhcU12iLgwgVhCIgjNYCvAOyklaYCOB2h1UtS1/34u5VYyfgclWL6R8ZZRo6+QG RupL5bBmPQQtlFfJru0p3xk7eD7QYRmxYb72D9UzCXXfI2dWPi+lnCUBGBv/+HXApUIC Y8yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kqLbuKHW; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=fail (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 r8-v6si8100476plj.40.2018.06.22.01.10.20; Fri, 22 Jun 2018 01:10:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kqLbuKHW; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754345AbeFVIKR (ORCPT + 1 other); Fri, 22 Jun 2018 04:10:17 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:37325 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754339AbeFVIKO (ORCPT ); Fri, 22 Jun 2018 04:10:14 -0400 Received: by mail-pf0-f195.google.com with SMTP id y5-v6so2845087pfn.4 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=p9P7bmam6dPlpDmdT8furC4UCKEHda/fZ+KHEyj3ExxhSRMF5643J6vGoSI6Rf1PUb PSlJyWxw3UkIETV83fhKI4Sdp6w+ltIr1LHfy3nGNI46rLQgWooKhzDlDa2yjKa1iUKW rlIbKFceCMhOMNCJoA6VudopGQ/8GttL97vuKDRRmjhuj0vje2f/DE+sMS240R9hwU21 sXuQmfAN+rveXKREZIzlCO7UI/3oE3/vBvr5fTNiYe2rqxtcLRAjqCAdMzlqZiA2JxW8 ud/5or6LGZTffo606dnoy61s4yxFJdBiZ27sspiaXs2LYZSmLacH7IpIWUUpmAQiO3X8 2j+A== X-Gm-Message-State: APt69E1ajJL8RY2bFI9EKFxpORB6IX3gpcQxqsMI6BJG0zS6d5WTBOsU acwjaUY27348e7Ht5cf+qUhtwg== 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-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org 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(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }