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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BCD0C54EE9 for ; Tue, 27 Sep 2022 03:45:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229552AbiI0Dpa (ORCPT ); Mon, 26 Sep 2022 23:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiI0Dp3 (ORCPT ); Mon, 26 Sep 2022 23:45:29 -0400 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34EB6B089C for ; Mon, 26 Sep 2022 20:45:28 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id EF80F30000CCF; Tue, 27 Sep 2022 05:45:25 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id D2D7E10C2; Tue, 27 Sep 2022 05:45:25 +0200 (CEST) Date: Tue, 27 Sep 2022 05:45:25 +0200 From: Lukas Wunner To: Yang Yingliang Cc: linux-spi@vger.kernel.org, broonie@kernel.org, Geert Uytterhoeven Subject: Re: [PATCH -next 1/2] spi: introduce devm_spi_alloc_controller() Message-ID: <20220927034525.GA32253@wunner.de> References: <20220926142933.2299460-1-yangyingliang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220926142933.2299460-1-yangyingliang@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org [+cc Geert, who originally came up with "spi_controller"] On Mon, Sep 26, 2022 at 10:29:32PM +0800, Yang Yingliang wrote: > Introduce devm_spi_alloc_controller() to wrap __devm_spi_alloc_controller(), > with this wrapper, the drivers can use it to update to the modern naming. [...] > --- a/include/linux/spi/spi.h > +++ b/include/linux/spi/spi.h > @@ -778,6 +778,12 @@ static inline struct spi_controller *devm_spi_alloc_slave(struct device *dev, > return __devm_spi_alloc_controller(dev, size, true); > } > > +static inline struct spi_controller *devm_spi_alloc_controller(struct device *dev, > + unsigned int size) > +{ > + return __devm_spi_alloc_controller(dev, size, false); > +} > + > extern int spi_register_controller(struct spi_controller *ctlr); > extern int devm_spi_register_controller(struct device *dev, > struct spi_controller *ctlr); This doesn't really make sense I'm afraid. The umbrella term "spi_controller" can refer to either a master or a slave. One has to specify on allocation which of the two is desired. An API which purports to allow allocation of the umbrella term but defaults to a master behind the scenes seems misleading to me. Thanks, Lukas