Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3513197pxb; Mon, 24 Jan 2022 11:07:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeg47ABAjSuefqkXGIM73urLWBVOC/Qtx6O8raliRdLlDsphGbRFgVed86eCao8DjO2Sik X-Received: by 2002:a63:ae48:: with SMTP id e8mr12683316pgp.347.1643051264179; Mon, 24 Jan 2022 11:07:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643051264; cv=none; d=google.com; s=arc-20160816; b=MmdjdhsiIuc6sflb92FIld0A+eejwo7Byqb5XIbi1O4G1DQxiGJ7y2YbCCRGeJ5iO2 8c637QH5a5onCZC6OkJeJ+6r/lNlaws5Sy6SvFCErYPqNfIJJTj07DpbiBMW+SCGtHkz pQLLCr2UhxwV4plF/U7I6dyJVvLTTSmzTF+0d1hR0vkaW/tJGKfb9/Jj0HzJU1BcvMRm jPlflxA7bAFlnGQYlUYE5mXDGXQG2B4rd/PRQzy8vPf7g8SsNkN8lD9UO6dlmq7zeu8u wrlvUS/QSHGZE08njE9ngCkpyZeve9WuggLCG6n3+99UZjgajYbSf4GPb/H1geO3VPHW /NBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9J8Xu5HISDcAE01kWTIAiML/lr+TYu4y72krrdFaqGk=; b=vJiXm0it0SE6Z52eZHdJBXq33FK9rUlGuA+FYsmDJLJ6x7JcZ2ws+klipIEAlPc408 2skQF7Aafrf26ikjZfZAdoOW4+C6aaN7GByueKBcGxdrpr2xNdjWkQwwGP9Ph/nY3uoZ FiCZatcwLryMotiFR6QHwQByEnfmd2d0JiwGS3fJe+kzk+TcPdpa7JoyhNCudCBA7Eci mEvPVKZvHaTzUQ8hFAqajmxradhJffvLgHFbsK+hdZLmIm2X0eXF1LVVcsNJsza31Z5G ss5hLwbq7EKFVSdDzQVIXvjgRhFHavlEfF0R3qZsNqudYFEElr8mbI8SihzzlX3jPqnB gk0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UOSTw1zF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ob1si201666pjb.8.2022.01.24.11.07.25; Mon, 24 Jan 2022 11:07:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=UOSTw1zF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238236AbiAXMJY (ORCPT + 99 others); Mon, 24 Jan 2022 07:09:24 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:41612 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238134AbiAXMJX (ORCPT ); Mon, 24 Jan 2022 07:09:23 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 90FB01F42E77 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1643026162; bh=aOuYPLM5L/mmuMP/xuJRrEHY6ka8AQ/+E0HBxwte4rk=; h=From:To:Cc:Subject:Date:From; b=UOSTw1zFcyrq8krivX1eQH6s3kCIy1msupv2GSjycaN5568uej4szCz8kk1Sgi+o2 +1+FDKEjUhFUOGHySgTcntP4O1W0NlSHNfGOxKzbe1zmvZjH0rqomv+hFcNQYbzFyI zSsTn+oYkWBGIwXm/bBDK1laxNHsJS/GvgqE57DPF6SzGS4ZFeRVrTy5T/if6vIHch elcKf3nJoGvhFwpKfGwFrqxXAji7nWvfFP4+Y287AK6iW6MC/ZSoElO/lzIqdV0RxT YvKlm5ONN+3u0C2HKZuxXAtOgSfhCuoYbTG0kNGgiX/EiV7tXMebMWQQCzhbO1MjPt h2/xEgF2c9jPw== From: AngeloGioacchino Del Regno To: bjorn.andersson@linaro.org Cc: mathieu.poirier@linaro.org, matthias.bgg@gmail.com, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@collabora.com, AngeloGioacchino Del Regno Subject: [PATCH 1/3] remoteproc: mtk_scp: Use devm variant of rproc_alloc() Date: Mon, 24 Jan 2022 13:09:13 +0100 Message-Id: <20220124120915.41292-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To simplify the probe function, switch from using rproc_alloc() to devm_rproc_alloc(); while at it, also put everything on a single line, as it acceptably fits in 82 columns. Signed-off-by: AngeloGioacchino Del Regno --- drivers/remoteproc/mtk_scp.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index 36e48cf58ed6..95a40e3f11e3 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -756,11 +756,7 @@ static int scp_probe(struct platform_device *pdev) char *fw_name = "scp.img"; int ret, i; - rproc = rproc_alloc(dev, - np->name, - &scp_ops, - fw_name, - sizeof(*scp)); + rproc = devm_rproc_alloc(dev, np->name, &scp_ops, fw_name, sizeof(*scp)); if (!rproc) { dev_err(dev, "unable to allocate remoteproc\n"); return -ENOMEM; @@ -776,8 +772,7 @@ static int scp_probe(struct platform_device *pdev) scp->sram_base = devm_ioremap_resource(dev, res); if (IS_ERR((__force void *)scp->sram_base)) { dev_err(dev, "Failed to parse and map sram memory\n"); - ret = PTR_ERR((__force void *)scp->sram_base); - goto free_rproc; + return PTR_ERR((__force void *)scp->sram_base); } scp->sram_size = resource_size(res); scp->sram_phys = res->start; @@ -789,7 +784,7 @@ static int scp_probe(struct platform_device *pdev) ret = PTR_ERR((__force void *)scp->l1tcm_base); if (ret != -EINVAL) { dev_err(dev, "Failed to map l1tcm memory\n"); - goto free_rproc; + return ret; } } else { scp->l1tcm_size = resource_size(res); @@ -851,8 +846,6 @@ static int scp_probe(struct platform_device *pdev) for (i = 0; i < SCP_IPI_MAX; i++) mutex_destroy(&scp->ipi_desc[i].lock); mutex_destroy(&scp->send_lock); -free_rproc: - rproc_free(rproc); return ret; } -- 2.33.1