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 C744FC07E9D for ; Tue, 27 Sep 2022 11:57:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230290AbiI0L5L (ORCPT ); Tue, 27 Sep 2022 07:57:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232048AbiI0L5L (ORCPT ); Tue, 27 Sep 2022 07:57:11 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E585A1559CA for ; Tue, 27 Sep 2022 04:57:08 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4McJ2f5mqbzHqLV; Tue, 27 Sep 2022 19:54:50 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 19:57:06 +0800 Received: from [10.174.178.174] (10.174.178.174) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 27 Sep 2022 19:57:06 +0800 Subject: Re: [PATCH -next 1/2] spi: introduce devm_spi_alloc_controller() To: Mark Brown , Lukas Wunner CC: , Geert Uytterhoeven , References: <20220926142933.2299460-1-yangyingliang@huawei.com> <20220927034525.GA32253@wunner.de> From: Yang Yingliang Message-ID: <703c43ca-ab47-bfd9-da26-d435aaf236e5@huawei.com> Date: Tue, 27 Sep 2022 19:57:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.178.174] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Hi Mark, On 2022/9/27 19:21, Mark Brown wrote: > On Tue, Sep 27, 2022 at 05:45:25AM +0200, Lukas Wunner wrote: >> On Mon, Sep 26, 2022 at 10:29:32PM +0800, Yang Yingliang wrote: >>> 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. > Yes, we'd need to either have two wrappers using some more appropriate > terminology than master/slave or have a parameter which specifies the > role. Do you mean to introduce two more proper wrappers to instead of devm_spi_alloc_master/slave() ? Thanks, Yang