From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE051C54FCB for ; Wed, 22 Apr 2020 17:03:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB8E42082E for ; Wed, 22 Apr 2020 17:03:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726445AbgDVRDz (ORCPT ); Wed, 22 Apr 2020 13:03:55 -0400 Received: from verein.lst.de ([213.95.11.211]:53680 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726057AbgDVRDz (ORCPT ); Wed, 22 Apr 2020 13:03:55 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id F271B68C4E; Wed, 22 Apr 2020 19:03:49 +0200 (CEST) Date: Wed, 22 Apr 2020 19:03:49 +0200 From: Christoph Hellwig To: Ulf Hansson Cc: Greg Kroah-Hartman , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, Arnd Bergmann , Christoph Hellwig , Russell King , Linus Walleij , Robin Murphy , Vinod Koul , Haibo Chen , Ludovic Barre , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, stable@vger.kernel.org Subject: Re: [RESEND PATCH v2 1/2] driver core: platform: Initialize dma_parms for platform devices Message-ID: <20200422170349.GA28781@lst.de> References: <20200422100954.31211-1-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200422100954.31211-1-ulf.hansson@linaro.org> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org On Wed, Apr 22, 2020 at 12:09:54PM +0200, Ulf Hansson wrote: > It's currently the platform driver's responsibility to initialize the > pointer, dma_parms, for its corresponding struct device. The benefit with > this approach allows us to avoid the initialization and to not waste memory > for the struct device_dma_parameters, as this can be decided on a case by > case basis. > > However, it has turned out that this approach is not very practical. Not > only does it lead to open coding, but also to real errors. In principle > callers of dma_set_max_seg_size() doesn't check the error code, but just > assumes it succeeds. > > For these reasons, let's do the initialization from the common platform bus > at the device registration point. This also follows the way the PCI devices > are being managed, see pci_device_add(). > > Suggested-by: Christoph Hellwig > Cc: > Tested-by: Haibo Chen > Reviewed-by: Arnd Bergmann > Signed-off-by: Ulf Hansson Looks good, Reviewed-by: Christoph Hellwig