Linux SPI subsystem development
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-spi@vger.kernel.org, broonie@kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH -next 1/2] spi: introduce devm_spi_alloc_controller()
Date: Tue, 27 Sep 2022 05:45:25 +0200	[thread overview]
Message-ID: <20220927034525.GA32253@wunner.de> (raw)
In-Reply-To: <20220926142933.2299460-1-yangyingliang@huawei.com>

[+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

  parent reply	other threads:[~2022-09-27  3:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-26 14:29 [PATCH -next 1/2] spi: introduce devm_spi_alloc_controller() Yang Yingliang
2022-09-26 14:29 ` [PATCH -next 2/2] spi: xilinx: switch to use spi_controller_*() functions Yang Yingliang
2022-09-27  3:45 ` Lukas Wunner [this message]
2022-09-27  7:11   ` [PATCH -next 1/2] spi: introduce devm_spi_alloc_controller() Geert Uytterhoeven
2022-09-27 11:21   ` Mark Brown
2022-09-27 11:57     ` Yang Yingliang
2022-09-27 13:31       ` Lukas Wunner
2022-09-27 17:01         ` Mark Brown
2022-09-27 20:19           ` Lukas Wunner
2022-09-27 20:22             ` Mark Brown
2022-09-27 20:43               ` Geert Uytterhoeven
2022-09-28 11:15                 ` Mark Brown
2022-09-28 15:01                   ` Yang Yingliang
2022-09-28 16:08                     ` Mark Brown
2022-09-28 15:11                   ` Lukas Wunner
2022-09-28 15:58                     ` Mark Brown
2022-09-28 17:14                     ` Geert Uytterhoeven
2022-09-28  6:34               ` Yang Yingliang
2022-09-28 11:10                 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220927034525.GA32253@wunner.de \
    --to=lukas@wunner.de \
    --cc=broonie@kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox