Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2637213pxj; Mon, 31 May 2021 07:07:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4iiXxBl7ALRoCWIJVcca8y/B+4JfisLp1EgIXCuMTEEjZ1UIsTEVFKMLvJ8gUfJJOWfdJ X-Received: by 2002:a05:6602:3427:: with SMTP id n39mr17923110ioz.157.1622470020212; Mon, 31 May 2021 07:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622470020; cv=none; d=google.com; s=arc-20160816; b=J+Z9gVaaqayrrT9ii6dyR4uSTwzLyKkkRgi95bVIqkPxXbg6DQJ/BMGlIfiwWF/gb9 hJL8nAiZuQhlZNRv5ZtuQlFbtqI7B6vO364NvIevSkB0jdHxcs11AlK6XqupAteImeQp sfIG2UzRFVU+Gtrgv14MMkpjE1ohkuuIpZeK8//ja86b0NSvK0z2P7fYlU1jSzCLILP+ LGhCEMuBM3dDWvNYMhGNzDC19dh/j1ZNz8xSGrJFyEaHupnuEtacM8R2jUzNbg7rbfiE em3pG1j/v2tkA/EPfbHvsC6Qsk9T8nDycA60PCY9OpZvy6FUzwZLUbNSbpO0og0qTVRP NOig== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iIV9eOKne+stWxkKMIrm0Sy9a1jgaWSDmfDbLoXZZqM=; b=NjqjYrWmZGQrpRAD6it2PCOMR5SjiqKST6hMlg8Sa6YYcodM7HeJk4cAyLJlZB75rd VxzFud2sVTYzR4erRDu3kwEeiVimMC55l/HG/CAMElINLXTEFfnvOe7kABtY+ZYKK0eE /OCWAm4D3PFc4iDaC+jTQfzd9KGqBQ9AcyQIU7gYx5+xcpIHdeAr26FPkaywRmlmF7AX CN9NltqQ43ggYBBhTm3bjR3TcG7T3p5sNgIxvxvPNVA0sdhvz1jBciEPoDe+mvRAUPAn uuSwYcuZqv06oC8aEjX5GJZ9iafXdzemzhsyRLMLBIXA9hG1h5zjgPAsfg13d0F47DX3 NIOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=A3HntQf8; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si11831981ila.56.2021.05.31.07.06.47; Mon, 31 May 2021 07:07:00 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=A3HntQf8; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233380AbhEaOHm (ORCPT + 99 others); Mon, 31 May 2021 10:07:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:44892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232227AbhEaNmg (ORCPT ); Mon, 31 May 2021 09:42:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EC1CD61481; Mon, 31 May 2021 13:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467710; bh=efU9PGSbDtdu1/hSrc3mX1eRJyc9rgg2Flsb++jTol4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A3HntQf8sz4g/uzFOPbrkhjyFC96W6b+HCw4lGq9AAHtQ+u/VTySP/ggR0e2B+a/F df0YTKSmGqtDWd5m3hOo3Xt3dtvslmWUGpefT3C9AwVT7r638QNrycJCNX4yybq7A9 Y7i1xhLlDbd76hv3sngSdBREYb2njJa/nVYkjQ+I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinod Koul , Sinan Kaya , Phillip Potter , Sasha Levin Subject: [PATCH 4.14 52/79] dmaengine: qcom_hidma: comment platform_driver_register call Date: Mon, 31 May 2021 15:14:37 +0200 Message-Id: <20210531130637.672660409@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130636.002722319@linuxfoundation.org> References: <20210531130636.002722319@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Phillip Potter [ Upstream commit 4df2a8b0ad634d98a67e540a4e18a60f943e7d9f ] Place a comment in hidma_mgmt_init explaining why success must currently be assumed, due to the cleanup issue that would need to be considered were this module ever to be unloadable or were this platform_driver_register call ever to fail. Acked-By: Vinod Koul Acked-By: Sinan Kaya Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20210503115736.2104747-52-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/dma/qcom/hidma_mgmt.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/dma/qcom/hidma_mgmt.c b/drivers/dma/qcom/hidma_mgmt.c index 7335e2eb9b72..fd1b3a09de91 100644 --- a/drivers/dma/qcom/hidma_mgmt.c +++ b/drivers/dma/qcom/hidma_mgmt.c @@ -454,6 +454,20 @@ static int __init hidma_mgmt_init(void) hidma_mgmt_of_populate_channels(child); } #endif + /* + * We do not check for return value here, as it is assumed that + * platform_driver_register must not fail. The reason for this is that + * the (potential) hidma_mgmt_of_populate_channels calls above are not + * cleaned up if it does fail, and to do this work is quite + * complicated. In particular, various calls of of_address_to_resource, + * of_irq_to_resource, platform_device_register_full, of_dma_configure, + * and of_msi_configure which then call other functions and so on, must + * be cleaned up - this is not a trivial exercise. + * + * Currently, this module is not intended to be unloaded, and there is + * no module_exit function defined which does the needed cleanup. For + * this reason, we have to assume success here. + */ platform_driver_register(&hidma_mgmt_driver); return 0; -- 2.30.2