Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp432023lqp; Mon, 10 Jun 2024 08:22:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVrf0TR9QXJa2/+IT1tpvg38zsidVZwgiACO5LK7g2uOTa8/WzQUIQY7XpvV/qHk9opRRKegvwLY1aNWSZxsOOrGJ0nfn9t3qBrP7ArOg== X-Google-Smtp-Source: AGHT+IFjqxZxxbryKD+BJasP9itSYC+MmL+PbLMEh4L1p+MPn5bg1Qmvl2+8Ieu7FI387OH4fhPy X-Received: by 2002:a05:6214:5a04:b0:6ad:8040:e8d4 with SMTP id 6a1803df08f44-6b059cf2a36mr118880356d6.33.1718032921523; Mon, 10 Jun 2024 08:22:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718032921; cv=pass; d=google.com; s=arc-20160816; b=c6k/evvNQnDiZdJ05wuWg5wSH951XP2wcejSr/PnSyxmXny+/QnDvO2Itx9XcfcKKJ 3CkCQUHleu9lCU6UTxlEAb7wHDi3mS16BizZibyh5ky4Te7f7xkru0Xu/+HLnGjo3zWF BG9P2TQ6OFm0VJuU7CDeD8WVKHG2FEAvDd60sftWGY4uaHwnkXSuBwCJoTkmYWnfZHb9 tqEpnDT4emrnEBkB2eThw7scMIzWWKaP+M7O/yQDRJ0cBo6xYSJzSsWSQ9wiUJs4TDbX DRd6iVLTfRONRL36jH4H4LkYB7Qn1kyva3/sngWM9Xb3GVUjpHCq8z+czwjW3SodxoG+ OkSw== 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=S6CAbyqppimi4za1W8UTwhhlNLZYFkY8msmfDKM8H40=; fh=7gyyxKLdNxw/+wLX/xbi71mpuxCiOZFN8x453bmxIcE=; b=0Yc7TbQJgUmRlz0nIE9iOUoY+IXlfLjXROARYEQS4BddZAapzxucWrKt1uISYPfhv7 NweQWGZdKR0tw9jUVh32QnOq4mna3ZDLkzKytZcTy7c1kklEXYKK062dsHKxZBHf7NdY CdvMoD4s1x6P1He1K4S424aJNvAfqdWiszl9Y7iTR5CnBSRmDGsDVJRuD8jPCnjhFbv9 /HBv+FQXXanxXED8rLNCniTovm+oiLXRyDsQK9qKAsmrWIHVO8kWk4xnl+s8vCDG1dHu v2agiG/Cft9P8P97QRLsuVsF/hQYlL2PGhhu+apnj4z/6z6DvbSzS15zVkr0ndrxYa21 no0A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nlJLHuRH; 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-208461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208461-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. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6b07a6d3725si32050086d6.486.2024.06.10.08.22.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 08:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=nlJLHuRH; 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-208461-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208461-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 40CCC1C2389D for ; Mon, 10 Jun 2024 15:22:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4FD4152534; Mon, 10 Jun 2024 15:17:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="nlJLHuRH" Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 83D611420DD; Mon, 10 Jun 2024 15:17:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.249 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718032650; cv=none; b=iwNqNeu3QY4SnOEQ6/3mjdIMhc3LGQnCXEQpcmxNe3E5+RyUEtuyuHJyDe67Uz89GQE5vGmAGKw3VZPBWiw40z7bZcIjAFIG22WbKLeLKI3zoJ9pIUJhvuglyH1G4zbq5jJB3v3lHCXze7/Wbt0G04HNQZ8qU8ImusaADne3mtA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718032650; c=relaxed/simple; bh=1+VmIOqLzP9/9IDW1FCErix7AzPjQR66MWqohWtZ9lc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OUpIOQjAne8AsQcSVvpTto6EbTEbeuO7ezzcRBIjyQq8NfFmfaqLqcfwaNGGhUNgLlMk3BKbl0YlehR6YQWtymUD1aSNX3xcx6N4qpKJcolZWtpbaWCvWbjBn8QQLWWm/VYvJvc74bSVQZ2yvouhFHagYc2pphF4AZ0l+CCSSqk= 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=nlJLHuRH; arc=none smtp.client-ip=198.47.23.249 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 fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 45AFHOIa031242; Mon, 10 Jun 2024 10:17:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1718032644; bh=S6CAbyqppimi4za1W8UTwhhlNLZYFkY8msmfDKM8H40=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=nlJLHuRHVtECND7ftf8DJAwRs0ypOIgMSIN1UMiy8f649XLdiLQTr4dY9pxfvqM3y Yb1vD2d9Xjw0znAfZav6Mu7tHimIa62krNnF+apZgGL9wR7FYP2UeTtBN9a61eZChP swhZ5POZIun7tv7mT7kn4hd8pdjAokSbW0R5FDw8= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 45AFHOAj031340 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 10 Jun 2024 10:17:24 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 10 Jun 2024 10:17:24 -0500 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE103.ent.ti.com (10.64.6.24) 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; Mon, 10 Jun 2024 10:17:24 -0500 Received: from fllvsmtp7.itg.ti.com ([10.249.42.149]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 45AFHMqg017714; Mon, 10 Jun 2024 10:17:24 -0500 From: Andrew Davis To: Hari Nagalla , Bjorn Andersson , Mathieu Poirier CC: , , Andrew Davis Subject: [PATCH 6/6] remoteproc: da8xx: Use devm_rproc_add() helper Date: Mon, 10 Jun 2024 10:17:21 -0500 Message-ID: <20240610151721.189472-6-afd@ti.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240610151721.189472-1-afd@ti.com> References: <20240610151721.189472-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 add function. This helps prevent mistakes like deleting out of order in cleanup functions and forgetting to delete on error paths. Signed-off-by: Andrew Davis --- drivers/remoteproc/da8xx_remoteproc.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/remoteproc/da8xx_remoteproc.c b/drivers/remoteproc/da8xx_remoteproc.c index 1ce91516fc6e5..c20cf33429da9 100644 --- a/drivers/remoteproc/da8xx_remoteproc.c +++ b/drivers/remoteproc/da8xx_remoteproc.c @@ -321,8 +321,6 @@ static int da8xx_rproc_probe(struct platform_device *pdev) if (ret) return ret; - platform_set_drvdata(pdev, rproc); - /* everything the ISR needs is now setup, so hook it up */ ret = devm_request_threaded_irq(dev, irq, da8xx_rproc_callback, handle_event, 0, "da8xx-remoteproc", @@ -347,7 +345,7 @@ static int da8xx_rproc_probe(struct platform_device *pdev) drproc->irq_data = irq_data; drproc->irq = irq; - ret = rproc_add(rproc); + ret = devm_rproc_add(dev, rproc); if (ret) { dev_err(dev, "rproc_add failed: %d\n", ret); return ret; @@ -356,22 +354,6 @@ static int da8xx_rproc_probe(struct platform_device *pdev) return 0; } -static void da8xx_rproc_remove(struct platform_device *pdev) -{ - struct rproc *rproc = platform_get_drvdata(pdev); - struct da8xx_rproc *drproc = rproc->priv; - struct device *dev = &pdev->dev; - - /* - * The devm subsystem might end up releasing things before - * freeing the irq, thus allowing an interrupt to sneak in while - * the device is being removed. This should prevent that. - */ - disable_irq(drproc->irq); - - rproc_del(rproc); -} - static const struct of_device_id davinci_rproc_of_match[] __maybe_unused = { { .compatible = "ti,da850-dsp", }, { /* sentinel */ }, @@ -380,7 +362,6 @@ MODULE_DEVICE_TABLE(of, davinci_rproc_of_match); static struct platform_driver da8xx_rproc_driver = { .probe = da8xx_rproc_probe, - .remove_new = da8xx_rproc_remove, .driver = { .name = "davinci-rproc", .of_match_table = of_match_ptr(davinci_rproc_of_match), -- 2.39.2