Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2623515pxj; Mon, 31 May 2021 06:49:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy770fl791gwIy3gxwyvHltysb3+3CUJVUPVlDlcnIG214vqxR4SRoUYoartRaDbIjwX7EM X-Received: by 2002:a02:ab84:: with SMTP id t4mr7938758jan.76.1622468944259; Mon, 31 May 2021 06:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622468944; cv=none; d=google.com; s=arc-20160816; b=wV0lFVQLOb17nWJh5EQJ0Tdew8R7n2WakP2K4Aw1O2kFfrS4p9ISGUcMjK26DvyI7e EjQ+UEBT0TNwtg5/cj3QPzBPQnPMGp3cJ7RGEXtv0UcF/x2cfPtE/C4lKb1APzO1Csk0 p/HJPYqk6/IVvQNBNjNOV4qyw894WBtkLhglu68m+jVJSRosVDndsb8zq2xQ5LfcRdg6 5iTdS4qhYt1U7YFj2zgXwVPmpl2jB0Wx2K/FJ/n6KJbw6bl6daPVSDIFKOa6EmwF3CYj Xn+zlA9i/536c6aVEhnfyvN+NbcqxDYQHUs/N3p+TQaWFwROr6F4M2vYLQilKEWZJG3B SYOg== 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=EzgWhSR1IlkZwFTGPXpXTl+dmM+AedreI8fd3soIJlU=; b=idLBMSWkOxckVVS5m6GL2ngpX71a42zn9W2xLUE3sKU1YWaIKl5wmbmYqBIkbWmSff oL2J1gLvP78jfN8VYHgdrlQ9wdTNAN+5rRcTy7v3MJvBF7XakDUBSK3TyQbR7GP2ZtIP 9X4CdW4j9uw+ZVDpd7rmKKkseCGuUP11qxRy5lX+4R1AIIj9sIeGMDjHnZM396iZfHgf XAp/QJebWZ1dcm75RcO6G0nttVt5HvZp+l1affuc7lmxR0KK6n8FqE2EKJ0hoatt8gvt m1vbirsQhC8YakcyU9lZ/GzvmGZqM8ZPcmXQ6WTvADqDPvpUJEvPe3k90P9Z+GviU2ej hBuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NZvb3IBv; 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 r84si14902998jac.11.2021.05.31.06.48.50; Mon, 31 May 2021 06:49:04 -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=NZvb3IBv; 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 S232054AbhEaNsU (ORCPT + 99 others); Mon, 31 May 2021 09:48:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:39364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232278AbhEaNde (ORCPT ); Mon, 31 May 2021 09:33:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3D8F06143E; Mon, 31 May 2021 13:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467480; bh=VHyJePAyYhLaCiPGvFQJSh66K3zPSB0orscaqg9bJV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NZvb3IBvwjy1m86PoYHIaZBw3f56TX+hz66Q8oopMk1SH6HnvEA8+1PPmpvuI6Cvi 5H+yUxgWBiZoWSQmbB3lSFCRBtbzhrTZ45577EycG6uj5WQQUDN9z2/yy0ha6ne77r WQsl2Lmb9i3EF+dlzEA+VhrrOc0heCigNr/znLgc= 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.19 082/116] dmaengine: qcom_hidma: comment platform_driver_register call Date: Mon, 31 May 2021 15:14:18 +0200 Message-Id: <20210531130642.940990873@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130640.131924542@linuxfoundation.org> References: <20210531130640.131924542@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 d64edeb6771a..f9640e37b139 100644 --- a/drivers/dma/qcom/hidma_mgmt.c +++ b/drivers/dma/qcom/hidma_mgmt.c @@ -423,6 +423,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