From patchwork Fri Sep 27 08:27:41 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: 174605 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3180436ill; Fri, 27 Sep 2019 01:28:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5b8Vb1lmSD5L6C/+YGMTqy4jJEkSnKcYX0uLcCMNWYTl0Kgg4S4h9UR1RxtMRfq5qfy1R X-Received: by 2002:a50:f0d4:: with SMTP id a20mr3206924edm.149.1569572891332; Fri, 27 Sep 2019 01:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569572891; cv=none; d=google.com; s=arc-20160816; b=cAcRYFlN8L8H7n0/DdUzxesFtwPeAqUAPu7E6GNOx91ZcBE58pne3VOZd2tcMlNy5+ shzH4qSVcuEwnJuvFjO50MKgrzBTm5PjDPRt7n+3WGz8KFOczUJDgNYFaz6gPMzg934E CU65kqtp9a5DKuZd3LEbRQiIyuu8me4nsWBO+5dElrDtx3NqlBwXpZNYMpAF028V6DPw 4O3S+7V6to18kew8xF8OF7wnY8LpW/6ZPzz480Gdt/m51sVaYPk60+hI178lnM21Ib1S E6GVKvchSMNzecfcBdshHlJOGRi+5lQb1LY6M6G3Y+zsx7Krybl8FWSgMP82m96hVwjC v4Og== 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=kup3jsm2T4Dp1CMpcneLGkz+TmvPB+cIre+Bt8N3oes=; b=ZJ6DXYWXtcuqiEz6c5UWnOQA4ii8iyv7y6nO3TTtF5S50sLj3o/a3f78efn1WgZvPs UItmP/Htb0EriqrWrjMXd5bCmoPjs2NrLpYF0hFxH2fQOLSBGAixqigyR5vsJkExMx8b xdZkWpCtstOZ77ANHkeuGUpBEGom4FW8tE547e+K8zcHMpyXPjAFtOHGNFHNmM+o0z/f b+E9aCITwH7Kx0BaHbxsVMWGPBFXYYuAGnUoBqZ4U6t0vajW1AKuo/203LpfvRg/iSWp n7FGwxWu0hcuXJ8dgD/Ua41Yn/uYNCFfXKiYlPw7mqZ92m+SHX5dQ42iQdeo7ydOs2Xn gqOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rpICZtHU; 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 q1si1155113edj.354.2019.09.27.01.28.11; Fri, 27 Sep 2019 01:28:11 -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=rpICZtHU; 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 S1727102AbfI0I2K (ORCPT + 26 others); Fri, 27 Sep 2019 04:28:10 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:39827 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726730AbfI0I2J (ORCPT ); Fri, 27 Sep 2019 04:28:09 -0400 Received: by mail-pl1-f195.google.com with SMTP id s17so785588plp.6 for ; Fri, 27 Sep 2019 01:28:09 -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=kup3jsm2T4Dp1CMpcneLGkz+TmvPB+cIre+Bt8N3oes=; b=rpICZtHUVuixBVO9d63gc3dXlVxb5YYThUJCocG9ApQJYbNo/LxFKtQU5BHzYCzDwc wCoL5g5ttpMFs/gbhX3z9ojugOa2fWlQFa7Rd0LuJWQlT+IQe4lH4qxsWUOIMVSwqUXT uTT4JjV0ZBtr/GFzstQh90Zi5rpxlUijH+SZbUin3I289fbhcDde8eQaG1MamGu5F0NA wl2mgKMeTLY+dmDZmccS56NY/VpJT6knhUULKFmcsBQ6XqF6r8Wdez3brkUpGhmQgTpU HxHA3lwnbreMfHFCPN3M+6mSIcAEFwH/l6t4MELLMgZMOTXY+TMC3qRQLibaDWs44W2H c71w== 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=kup3jsm2T4Dp1CMpcneLGkz+TmvPB+cIre+Bt8N3oes=; b=gBIgyGdIER0Wgsg54B6PhXEkdz+kExg2vtU1+iHjbDvKC/h9aafTJF35Q2t7BCr5qI icJqNve5wZBUkYmnt7oNXwe2HazzjQdBqg7vnpSBueNhD6EAuA4DxLv9ADQdaNiQm5Dd naI7qh+qUS/YDsWwuQ7gWql32+cUAG6LWl/+TqGVj3miAQusU8UGZqKu5fkOoX6SK7HJ /IZMBQMaTT+g6lWoknm91gnsmvOOtwamdQLED8KfAzSXxMk3vp8VzMFrAx4/6+cb86zP IOD4KODTzwTcb6jusvVBR3OS5YcpaDzRjyvlxygANtYZNwuAByxPXPa2G3h1BEoWxvmZ C9JA== X-Gm-Message-State: APjAAAV1YMMvCuNBKK+eO1zJoh60QBeeGrWDUuA77R9LJPpI+WDUgftB kekCnUPmKIbpNkfdZr/N8MgJ9w== X-Received: by 2002:a17:902:a985:: with SMTP id bh5mr3242251plb.107.1569572889229; Fri, 27 Sep 2019 01:28:09 -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.06 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Sep 2019 01:28:08 -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 1/3] hwspinlock: u8500_hsem: Change to use devm_platform_ioremap_resource() Date: Fri, 27 Sep 2019 16:27:41 +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 the new helper that wraps the calls to platform_get_resource() and devm_ioremap_resource() together, which can simpify the code. Signed-off-by: Baolin Wang --- drivers/hwspinlock/u8500_hsem.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) -- 1.7.9.5 Reviewed-by: Linus Walleij diff --git a/drivers/hwspinlock/u8500_hsem.c b/drivers/hwspinlock/u8500_hsem.c index 572ca79..c247a87 100644 --- a/drivers/hwspinlock/u8500_hsem.c +++ b/drivers/hwspinlock/u8500_hsem.c @@ -88,7 +88,6 @@ static int u8500_hsem_probe(struct platform_device *pdev) struct hwspinlock_pdata *pdata = pdev->dev.platform_data; struct hwspinlock_device *bank; struct hwspinlock *hwlock; - struct resource *res; void __iomem *io_base; int i, ret, num_locks = U8500_MAX_SEMAPHORE; ulong val; @@ -96,13 +95,9 @@ static int u8500_hsem_probe(struct platform_device *pdev) if (!pdata) return -ENODEV; - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) - return -ENODEV; - - io_base = ioremap(res->start, resource_size(res)); - if (!io_base) - return -ENOMEM; + io_base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(io_base)) + return PTR_ERR(io_base); /* make sure protocol 1 is selected */ val = readl(io_base + HSEM_CTRL_REG); @@ -112,10 +107,8 @@ static int u8500_hsem_probe(struct platform_device *pdev) writel(0xFFFF, io_base + HSEM_ICRALL); bank = kzalloc(struct_size(bank, lock, num_locks), GFP_KERNEL); - if (!bank) { - ret = -ENOMEM; - goto iounmap_base; - } + if (!bank) + return -ENOMEM; platform_set_drvdata(pdev, bank); @@ -135,8 +128,6 @@ static int u8500_hsem_probe(struct platform_device *pdev) reg_fail: pm_runtime_disable(&pdev->dev); kfree(bank); -iounmap_base: - iounmap(io_base); return ret; } @@ -156,7 +147,6 @@ static int u8500_hsem_remove(struct platform_device *pdev) } pm_runtime_disable(&pdev->dev); - iounmap(io_base); kfree(bank); return 0; From patchwork Fri Sep 27 08:27:42 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: 174606 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3180509ill; Fri, 27 Sep 2019 01:28:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfS6ehhGilYD0jcUzLbzUH+yoppp5CWJg8nHw2ChC+UhMsZGdKOc2KSSkN0uNSeR7ZhFeC X-Received: by 2002:a50:f19c:: with SMTP id x28mr3114801edl.42.1569572896829; Fri, 27 Sep 2019 01:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569572896; cv=none; d=google.com; s=arc-20160816; b=VgqHRDjhpblHzIRJ4yGg9nANv+wgRn2Ci4J6zzaBEhecJgBvwrJrIZUQqU22Ghfpex j/VjJR/1YQ2uUSwwB5pNZWIeSd1ye3XWxPVipMrpY+Gj7nAiBCZ03zBvcGys4zANhGlA ULEHgsUmtAPpnYF7uxsxSaorbQZqNrIR90dotFXyJ/xHR9ZrdIo0uZa61ryZsq58yRYs ACTcCDH9PLZt9sRkulrYzMP/5z4XtdKX24toR3SGE3+h4kCpQf1ohPgq99STqjwAp76f Wl1mhRvcnBe3hPAavdAM4Zu/gsI3dvIlGOCdjKsr2cxQCECE2VvOBN3rW53Rrfx3Dfsk sqAA== 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=vfYzArXzFe1wH00PAKP88fvUR7yXk6kDogWfZQY7lTA=; b=dPywu8HDnBefowSujbIZuR54YlTdE2XENQNxDOUD8E347Ay36QFhc7XZSM7/qOVqsP Ju9nO9RhsArVEbej2KXWlMMzq0p94rvceneaHBI0UBZ+Xf0v56nGrJs56WsKBfWV/IHX K2PicwIfMEEAYeW8JES7W5OQoyx2NvZYM4A8pwPPeC5UlHLgYiFi7QR4IH5iEbqC6X85 2psXRuyJj7xo4JM1QqPYAvrBo+hPJPGq/MAxupNbhT3gnD+FLnara09GxsmUdlQj3iWP aWdhVW4YzYbbQ3tQTSDKmx9Kaw/GCYWLbqyG/EYzUQMlKMGJcBLJHdEJU5jrJixxP/k0 cEVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S02hsAii; 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.16; Fri, 27 Sep 2019 01:28:16 -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=S02hsAii; 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 S1727134AbfI0I2P (ORCPT + 26 others); Fri, 27 Sep 2019 04:28:15 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39831 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726730AbfI0I2O (ORCPT ); Fri, 27 Sep 2019 04:28:14 -0400 Received: by mail-pl1-f194.google.com with SMTP id s17so785645plp.6 for ; Fri, 27 Sep 2019 01:28:12 -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=vfYzArXzFe1wH00PAKP88fvUR7yXk6kDogWfZQY7lTA=; b=S02hsAiiBDCmqzupGtJrjHkn9YV7Qk3fVrnsTFaEf6sC720aQY4Ev4M3phUHhoyUXI MhS3KIWNqIFoSEZ9lich9pbh8HtVr4OLUMuElnij8iezvsPEczpf/K0iQkU8Rp0xhYh5 81WPorMjBDzY30Bgf2aP14iEX6X+yCxfFuQETJoCQMyMEbl4b3XtP3NLTTHhC03+22H4 NXavZm7TMJ78BSG5rSUAA9EKWUY6hxC9cPrjWoPmOyhYiKrgNYMQlfMV5DdZ9LAXPJvi 9uuwzaRwlXD7Hc6rxLtLbGrzvMXmk+xrHc2BnfMn4hsODscVzEOaYAN5Q8di/h0WpLop LHEQ== 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=vfYzArXzFe1wH00PAKP88fvUR7yXk6kDogWfZQY7lTA=; b=akWEQxcnP9STGKVj4pQd2D2FE8VVAQHAg6N+qcFVHzX9vDkSgW4jQlp1QJ9/vRoYSN aTk4U1ZfhaVdso56eZY5XusvP44HPyi+mEEAaJ04NPxRYR1sCbooAsZg68CcUn1dMQxr x/l3Z01Vi8pr2UBfw2FEagesvZrknWVGzYZOsZ37MVAGFhdtoSjN+70S2Eo+FfHc4fjb OdGnvKst6E52gSAQA+uJBFhTswn/I7gLpq6rDhOOpZQnE1GL22K1GRXGyOCpEXYBeIET zysNKOUDi2Nzlzdext42srhsjJjuLOzx4gYB04by9IgjeEE0/Xr/Q0l5tMGreBHc0QfH 7DBg== X-Gm-Message-State: APjAAAXKv90116Y/7h5k0vq9kum81me4GneiTTo0XuqzM/YfMzK025gB eqflG3O/2QJIU/PkZ+Fn7bSkDQ== X-Received: by 2002:a17:902:820f:: with SMTP id x15mr3101252pln.230.1569572892248; Fri, 27 Sep 2019 01:28:12 -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.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Sep 2019 01:28:11 -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 2/3] hwspinlock: u8500_hsem: Use devm_kzalloc() to allocate memory Date: Fri, 27 Sep 2019 16:27:42 +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_kzalloc() to allocate memory. Signed-off-by: Baolin Wang --- drivers/hwspinlock/u8500_hsem.c | 15 ++++++--------- 1 file changed, 6 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 c247a87..0e8d4ff 100644 --- a/drivers/hwspinlock/u8500_hsem.c +++ b/drivers/hwspinlock/u8500_hsem.c @@ -106,7 +106,8 @@ static int u8500_hsem_probe(struct platform_device *pdev) /* clear all interrupts */ writel(0xFFFF, io_base + HSEM_ICRALL); - bank = kzalloc(struct_size(bank, lock, num_locks), GFP_KERNEL); + bank = devm_kzalloc(&pdev->dev, struct_size(bank, lock, num_locks), + GFP_KERNEL); if (!bank) return -ENOMEM; @@ -120,15 +121,12 @@ static int u8500_hsem_probe(struct platform_device *pdev) ret = hwspin_lock_register(bank, &pdev->dev, &u8500_hwspinlock_ops, pdata->base_id, num_locks); - if (ret) - goto reg_fail; + if (ret) { + pm_runtime_disable(&pdev->dev); + return ret; + } return 0; - -reg_fail: - pm_runtime_disable(&pdev->dev); - kfree(bank); - return ret; } static int u8500_hsem_remove(struct platform_device *pdev) @@ -147,7 +145,6 @@ static int u8500_hsem_remove(struct platform_device *pdev) } pm_runtime_disable(&pdev->dev); - kfree(bank); return 0; } 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;