Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2672556pxj; Mon, 31 May 2021 07:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFhkJylmnCnTML2N+DEpieM4dFfKhTLKzjJpJND8wnGSRmCg5HUxl4HidsE9cY/mDJjh+z X-Received: by 2002:a05:6e02:1147:: with SMTP id o7mr17612959ill.20.1622473053755; Mon, 31 May 2021 07:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622473053; cv=none; d=google.com; s=arc-20160816; b=Ze3o5ykGhc7SBeCBRB+NmeovScWs9nI63PS200PGaDLWZVNuJrRvcJFXFCNQmZIxCW Zn+vhUWM7oQQuMDtf7YQisJVEzR4SNnL5lLwJbEJTMk2U0bSvuPFPPoZbzoT6bVspH7c sZqK5HfRqqSf4rB+tTedD83cf3DsgT2KZqNONgedqfyvPO7AedCYoMgxjSF/GZYVLNgJ T5PwbFTOjLl+vemnKOZLECDcY9MdvJhD+MW+mQjSCMjcZ+PtZnKLIcHaaYJjM5pp5ttO iQ9Q7sR4WA5gifEqJybcaoCjlNzSFETrts544A05FSJXrJpv0QcrEa2+pOFVt1S4zG/H 6jng== 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=Yw+3IIwia+EXI/HGd0RtUonfAeCjrLjFGQK6psIZfrc=; b=q3XbU8nxVQVvz/WesmHbUn5oBkBX3npd4UG4RdWtBZBLDbt+RLLNN4lUujKR050mDi +3hqXqnwm2el3p4SfHaOOyNY/RHyHG9WAxLG5rFobcW+mMgonQID9cwidCX45ham4kBn xFzy7FlmGJD5SJy7ytRNtmSEWEnS+ug6rRmTyeRvdS5TbgjNcPLHbi/bvDfhLt5FqmqK 6+hwM/BoZQV/8BaDvDBh028udXd4tPxLNFFs++/F2Bf5MEaf2S+J/etoe71dAgoLPDC0 hWK1wciUsAnsLfwHgh5s+Fad0UMjrWiynfvsqsrRbBOacsRxu2yJ8gTxzpza/2dSPLgz 1nVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VURsmjU6; 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 w17si12892586iot.47.2021.05.31.07.57.20; Mon, 31 May 2021 07:57:33 -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=VURsmjU6; 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 S232739AbhEaO60 (ORCPT + 99 others); Mon, 31 May 2021 10:58:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:38074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233444AbhEaOE4 (ORCPT ); Mon, 31 May 2021 10:04:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B801561451; Mon, 31 May 2021 13:38:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468296; bh=FjffVfX7ZHBpMoEV5UGia/iEkAw5C7P7xXuBqUhqT+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VURsmjU66kViCnDMJXAmo5FUajxsYLarQ0aLtXSA75hsNE343ExCCkBvG7+e+HLHJ XVfseScrGn9ddIhVZJkhStAfntDuQ2GULEumH3ya4ndSji72y6By9HCgU2erPyld9j 5VqYR41DMdkok/nX55w38admAE5HB473xhTgpuIs= 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 5.10 155/252] dmaengine: qcom_hidma: comment platform_driver_register call Date: Mon, 31 May 2021 15:13:40 +0200 Message-Id: <20210531130703.273282204@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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 fe87b01f7a4e..62026607f3f8 100644 --- a/drivers/dma/qcom/hidma_mgmt.c +++ b/drivers/dma/qcom/hidma_mgmt.c @@ -418,6 +418,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