Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp665834rdb; Tue, 23 Jan 2024 10:49:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXWsG3dGrgchNNzltCQfINBonR1Ep88kY4e0AOx2a1vrtmz/3SzVoG62ciLnpDkKwlIEKI X-Received: by 2002:a05:620a:8:b0:783:8d11:ed42 with SMTP id j8-20020a05620a000800b007838d11ed42mr8206856qki.39.1706035742251; Tue, 23 Jan 2024 10:49:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706035742; cv=pass; d=google.com; s=arc-20160816; b=mAi6cPKXHzB/sY2ojMDLJVsdQZ8SVtViPMCJqZh9/5mi2FCUAKftizGjzXqXzj7O1/ XIHzSAMbuujK/f2w7E/U9YCZWOXWdSraXZBgG1gBvZRNuY8j+zKG6UNZquCg2ZJ7QroP 7UxUhA/3beavT0+KZmoKJLsl6EhoTThKi9LHDeYOkSaDmGz7BfU7n+a53Q8Wu+kf/U5T l1vBi+s5huFv2W/TyfFIUS2idJP65kUFgUWxLgxPEOH73vWUmDSBKCQwyNJJo5oBaWqz 5v7QTlaC16tZ6Dg4ByClt/IejrW2v0MY6VsD6sOr5eXgiZguDIEyglRNDxmCvSLc0rck uAMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+LsaequArBDt9r+xd6rw4/1iVgdQx4r0fsBkKYAhTUA=; fh=rmmMs/JsOUVHi++Wrl5ML8j1LcPsVgqH/ULrQQY0bCs=; b=S3HN34J8Hzd/48++SV4yucTtr0S5Fsgxc6Il3BXNBR1xHJA4vfqtVWPXzvJT53PB/G CNAIZaFRdv32WR4hUSZtcYlSJhZEMcWqO+NHBa0YkattO6CMEX2Bg0eiS0MtIbPDPMmC 2b3XqTyw/8l957yFU/DFwfSOTLVfAkWPQSOR46SUGjTtnuOtHD9LXUTOzE3Pti1M5nYn ScCkS2iJiEqT7n2GBwurMtc47xoKHBfZLRT8qpoLtuHTPpfkQK8SAHKFeaERvVAi0HLX z+Yx/qor1eCJVP5SYS3P4sRXw0McEEFR9rroIbP0cbuUqN1mAAOgFKHvQQPT9fA9+Dra 4l8A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RFfW3jho; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-35896-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35896-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id b1-20020a05620a0f8100b00783264580b0si8237715qkn.57.2024.01.23.10.49.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 10:49:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35896-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RFfW3jho; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-35896-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35896-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 094FA1C257C9 for ; Tue, 23 Jan 2024 18:49:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CDF9F1272C2; Tue, 23 Jan 2024 18:46:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="RFfW3jho" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1789C85C7E; Tue, 23 Jan 2024 18:46:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706035617; cv=none; b=tFKef/urrisay+gGHJxZ4WzJ2PvFda0AU3Hssew9MvPAluTQqNy5lEIeYD4YPQ89olTfiAHhsNbwxAnfscvTYm7FFTApcxSy666QmtZnFH40hkoIrsyOpRFlqljj1QRl4YVkKPdCBPvgCilEyNoax7W08FqZkutosu9rB/5y5d0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706035617; c=relaxed/simple; bh=lmRit2wwP0VKPeCChGmI/nU/kHnVMLUnIEtXfr5zJzY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rL03OeoMQAr2+c83lEl/YdRmi2v4zd/CcXcQ91SJSBfZT09tx1rftZfioQvbxY6wCEpotSObs538uunauHvOob3kRZgVqPLQAkIBhLsu9E7bIW2tiozpToD2eHOn0C+Y5piNBvJgihXpEaie+W0SbbC4wAVmRaEuRk4M+Ir7M1c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=RFfW3jho; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 40NIkdl1111746; Tue, 23 Jan 2024 12:46:39 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1706035599; bh=+LsaequArBDt9r+xd6rw4/1iVgdQx4r0fsBkKYAhTUA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=RFfW3jhoyar67nIU0PAaCWGcBz2wypQDH4G54Aesmr9IAf4IXQ6eNgJLVHSkTtXyp LAEco3r4B8jijvqbwE9VgMBAdli2aLBS83axjmoYSQYoFdhOe3v769AK8pfli9atuX chkih1L0Tmggt2IxsWnN3t6Io6uMJ/aY81D9XGlo= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 40NIkd6F009881 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 23 Jan 2024 12:46:39 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 23 Jan 2024 12:46:39 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 23 Jan 2024 12:46:39 -0600 Received: from lelvsmtp5.itg.ti.com ([10.249.42.149]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 40NIkX20063265; Tue, 23 Jan 2024 12:46:38 -0600 From: Andrew Davis To: Bjorn Andersson , Mathieu Poirier , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Konrad Dybcio , Patrice Chotard , Maxime Coquelin , Alexandre Torgue CC: , , , , Andrew Davis Subject: [PATCH 9/9] remoteproc: stm32: Use devm_rproc_alloc() helper Date: Tue, 23 Jan 2024 12:46:32 -0600 Message-ID: <20240123184632.725054-9-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240123184632.725054-1-afd@ti.com> References: <20240123184632.725054-1-afd@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Use the device lifecycle managed allocation function. This helps prevent mistakes like freeing out of order in cleanup functions and forgetting to free on error paths. Signed-off-by: Andrew Davis --- drivers/remoteproc/stm32_rproc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c index 4f469f0bcf8b2..fed0866de1819 100644 --- a/drivers/remoteproc/stm32_rproc.c +++ b/drivers/remoteproc/stm32_rproc.c @@ -843,7 +843,7 @@ static int stm32_rproc_probe(struct platform_device *pdev) if (ret) return ret; - rproc = rproc_alloc(dev, np->name, &st_rproc_ops, NULL, sizeof(*ddata)); + rproc = devm_rproc_alloc(dev, np->name, &st_rproc_ops, NULL, sizeof(*ddata)); if (!rproc) return -ENOMEM; @@ -897,7 +897,6 @@ static int stm32_rproc_probe(struct platform_device *pdev) dev_pm_clear_wake_irq(dev); device_init_wakeup(dev, false); } - rproc_free(rproc); return ret; } @@ -918,7 +917,6 @@ static void stm32_rproc_remove(struct platform_device *pdev) dev_pm_clear_wake_irq(dev); device_init_wakeup(dev, false); } - rproc_free(rproc); } static int stm32_rproc_suspend(struct device *dev) -- 2.39.2