Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3347657pxb; Fri, 4 Feb 2022 06:47:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJynmDUDIb8qmNcS6ZR7RdXu+H6zEx8846VxgHiuI/n56F7T2rOlsbtwndA5kRw/w7QRe6zZ X-Received: by 2002:a17:907:6e0e:: with SMTP id sd14mr2840827ejc.274.1643986046892; Fri, 04 Feb 2022 06:47:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643986046; cv=none; d=google.com; s=arc-20160816; b=RxUclY93tjfrdqILhL9WdypHcMOOMmL9bYbdCmqVaqjmW8Z1ujQ7QtT56yGSRZCDat wJgzPNkRsXy8AZUYIxZFhVpB5qPC1zovITDPUvrmeAId1pcZfGAYIXTfnnSUWAy2aFHL 5xc5xxAYBTWZNyBrfbkjx2vgopt3aiwdSe41QCX2vuFidxSbcTWrABMv7e/WR9mlX7aa lqJU19YGw0gUYqKRDhyplC+cZmmafOwGs3gq9LDHEH7i9xTv2URfejzRDOBkG+kyweDu ROk2xlu7PJYbrmWQ1kVvAjOsRsocAYELyb9gOeAkaTMuqoC+V5yZ2LMLp/ry39I+rQ6o 3osA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=yriV3jrREEgzkPR54dv4q5A+98LvC0ePS/Zx7NSyEBA=; b=jiKnR/o6PzYP9x+p9ionTJMrMVP1fmItjqL4vLC7La+CGgN+CKQdUbiDeLjaYHDXPr kW7t/JG2wEABXQGm7QB5B/GL7xXc00AbBdEChmeGsisRSOyCB/8oJOuaBy2+1WhkQD60 11RGUXcxd+gL3uQysku8PJR50P0x0uGUDnAVZ0jt+4ic4ZP3QL5r3LUAe6nbubzIbYpl /B+HsIRLnG+yNfBrUTubi3GzdXtTM3ZnNyGV66sK4RvJtmOMsauJgg4GZo5phHy/r3H9 q+U8TqFaXWDJ46iSzCTK9TOUiwM8TzTFzUtE8kpokbWRjzk2HpfCix4/EvTYkkJg6GdE E51A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12si1531303edz.238.2022.02.04.06.47.01; Fri, 04 Feb 2022 06:47:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239466AbiBAOwv (ORCPT + 99 others); Tue, 1 Feb 2022 09:52:51 -0500 Received: from mail-yb1-f181.google.com ([209.85.219.181]:44629 "EHLO mail-yb1-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236688AbiBAOwu (ORCPT ); Tue, 1 Feb 2022 09:52:50 -0500 Received: by mail-yb1-f181.google.com with SMTP id r65so51605829ybc.11; Tue, 01 Feb 2022 06:52:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yriV3jrREEgzkPR54dv4q5A+98LvC0ePS/Zx7NSyEBA=; b=4Z4UcrrVlRSgtlY90JBin8w2ceUpKwnPmfgpq6dd5utdBDO2JKv4XG58fjk+6UYDmC ewzcEYj7ap0rEECId92qrzkAROwPxEkyp8TG8qBAiwSOEQhqodgcyVika6k1p2qZ87oy Z/SYaD1KJUBvyA6nxbbULPuM9hzDLsHWU14BcZjtCdUCptAcFm5D5ub0FvVp6zpbzOzy O2iwuGvhPpdA9z5FwakwMmEDQfAzR6TtBB+dy3F9uo5pnIlNFWCiUN1aVBoABASh7k01 4GjCS4bIBO5yznRnPt5DUzaFgAqAGWBO9SxBCSIboLJUgjwKOs7uVUHhUk3zckzIaNNU AFnw== X-Gm-Message-State: AOAM532yoWyrtHIR6YmX9qdt8L3PfRgVUy+clnu3VcnLNTKlIR52sLZA +0uf5s4haR21L08euLKFTyqgvBnfk73LdahRhR6O1kI0 X-Received: by 2002:a05:6902:1507:: with SMTP id q7mr38572163ybu.343.1643727169529; Tue, 01 Feb 2022 06:52:49 -0800 (PST) MIME-Version: 1.0 References: <20220121172431.6876-1-sbinding@opensource.cirrus.com> <20220121172431.6876-2-sbinding@opensource.cirrus.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 1 Feb 2022 15:52:38 +0100 Message-ID: Subject: Re: [PATCH v6 1/9] spi: Make spi_alloc_device and spi_add_device public again To: Hans de Goede Cc: Stefan Binding , Mark Brown , "Rafael J . Wysocki" , Len Brown , Mark Gross , Jaroslav Kysela , Takashi Iwai , "moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM..." , Linux Kernel Mailing List , linux-spi , ACPI Devel Maling List , Platform Driver , patches@opensource.cirrus.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 1, 2022 at 3:26 PM Hans de Goede wrote: > > Hi, > > On 1/21/22 18:24, Stefan Binding wrote: > > This functions were previously made private since they > > were not used. However, these functions will be needed > > again. > > > > Partial revert of commit da21fde0fdb3 > > ("spi: Make several public functions private to spi.c") > > > > Signed-off-by: Stefan Binding > > Thanks, patch looks good to me: > > Reviewed-by: Hans de Goede The series also looks good to me from the ACPI side, so what tree should it go into? > > --- > > drivers/spi/spi.c | 6 ++++-- > > include/linux/spi/spi.h | 12 ++++++++++++ > > 2 files changed, 16 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c > > index 4599b121d744..1eb84101c4ad 100644 > > --- a/drivers/spi/spi.c > > +++ b/drivers/spi/spi.c > > @@ -532,7 +532,7 @@ static DEFINE_MUTEX(board_lock); > > * > > * Return: a pointer to the new device, or NULL. > > */ > > -static struct spi_device *spi_alloc_device(struct spi_controller *ctlr) > > +struct spi_device *spi_alloc_device(struct spi_controller *ctlr) > > { > > struct spi_device *spi; > > > > @@ -557,6 +557,7 @@ static struct spi_device *spi_alloc_device(struct spi_controller *ctlr) > > device_initialize(&spi->dev); > > return spi; > > } > > +EXPORT_SYMBOL_GPL(spi_alloc_device); > > > > static void spi_dev_set_name(struct spi_device *spi) > > { > > @@ -652,7 +653,7 @@ static int __spi_add_device(struct spi_device *spi) > > * > > * Return: 0 on success; negative errno on failure > > */ > > -static int spi_add_device(struct spi_device *spi) > > +int spi_add_device(struct spi_device *spi) > > { > > struct spi_controller *ctlr = spi->controller; > > struct device *dev = ctlr->dev.parent; > > @@ -673,6 +674,7 @@ static int spi_add_device(struct spi_device *spi) > > mutex_unlock(&ctlr->add_lock); > > return status; > > } > > +EXPORT_SYMBOL_GPL(spi_add_device); > > > > static int spi_add_device_locked(struct spi_device *spi) > > { > > diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h > > index 7ab3fed7b804..0346a3ff27fd 100644 > > --- a/include/linux/spi/spi.h > > +++ b/include/linux/spi/spi.h > > @@ -1452,7 +1452,19 @@ spi_register_board_info(struct spi_board_info const *info, unsigned n) > > * use spi_new_device() to describe each device. You can also call > > * spi_unregister_device() to start making that device vanish, but > > * normally that would be handled by spi_unregister_controller(). > > + * > > + * You can also use spi_alloc_device() and spi_add_device() to use a two > > + * stage registration sequence for each spi_device. This gives the caller > > + * some more control over the spi_device structure before it is registered, > > + * but requires that caller to initialize fields that would otherwise > > + * be defined using the board info. > > */ > > +extern struct spi_device * > > +spi_alloc_device(struct spi_controller *ctlr); > > + > > +extern int > > +spi_add_device(struct spi_device *spi); > > + > > extern struct spi_device * > > spi_new_device(struct spi_controller *, struct spi_board_info *); > > > > >