From: Yang Yingliang <yangyingliang@huawei.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: <linux-spi@vger.kernel.org>, <broonie@kernel.org>,
<lukas@wunner.de>, <yangyingliang@huawei.com>
Subject: Re: [PATCH -next] spi: introduce new helpers with using modern naming
Date: Thu, 6 Oct 2022 13:56:46 +0800 [thread overview]
Message-ID: <db73bb30-bd64-41c3-1be9-001ae63c383d@huawei.com> (raw)
In-Reply-To: <CAMuHMdX1JMs3uAgJ6CS0sHxD69mp1Atx+YtsYuhy0ZUqsTHRQw@mail.gmail.com>
Hi,
On 2022/9/30 17:32, Geert Uytterhoeven wrote:
> Hi Yang,
>
> On Thu, Sep 29, 2022 at 3:04 PM Yang Yingliang <yangyingliang@huawei.com> wrote:
>> For using modern names host/target to instead of all the legacy names,
>> I think it takes 3 steps:
>> - step1: introduce new helpers with modern naming.
>> - step2: switch to use these new helpers in all drivers.
>> - step3: remove all legacy helpers and update all legacy names.
>>
>> This patch is for step1, it introduces new helpers with host/target
>> naming for drivers using.
>>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> Thanks for your patch!
>
>> --- a/include/linux/spi/spi.h
>> +++ b/include/linux/spi/spi.h
>> @@ -356,6 +356,7 @@ extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch
>> * @max_speed_hz: Highest supported transfer speed
>> * @flags: other constraints relevant to this driver
>> * @slave: indicates that this is an SPI slave controller
>> + * @target: indicates that this is an SPI target controller
>> * @devm_allocated: whether the allocation of this struct is devres-managed
>> * @max_transfer_size: function that returns the max transfer size for
>> * a &spi_device; may be %NULL, so the default %SIZE_MAX will be used.
>> @@ -438,6 +439,7 @@ extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch
>> * @mem_caps: controller capabilities for the handling of memory operations.
>> * @unprepare_message: undo any work done by prepare_message().
>> * @slave_abort: abort the ongoing transfer request on an SPI slave controller
>> + * @target_abort: abort the ongoing transfer request on an SPI target controller
>> * @cs_gpiods: Array of GPIO descs to use as chip select lines; one per CS
>> * number. Any individual value may be NULL for CS lines that
>> * are not GPIOs (driven by the SPI controller itself).
>> @@ -535,6 +537,8 @@ struct spi_controller {
>>
>> /* Flag indicating this is an SPI slave controller */
>> bool slave;
>> + /* Flag indicating this is an SPI target controller */
>> + bool target;
> To avoid subtle breakage when accessing these fields directly,
> this should be a union:
>
> union {
> bool slave;
> bool target;
> };
Yes, we should initialize the 'target' member. I will change it in v2.
Thanks,
Yang
>> /*
>> * on some hardware transfer / message size may be constrained
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds
>
> .
prev parent reply other threads:[~2022-10-06 5:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 13:20 [PATCH -next] spi: introduce new helpers with using modern naming Yang Yingliang
2022-09-30 9:32 ` Geert Uytterhoeven
2022-10-06 5:56 ` Yang Yingliang [this message]
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=db73bb30-bd64-41c3-1be9-001ae63c383d@huawei.com \
--to=yangyingliang@huawei.com \
--cc=broonie@kernel.org \
--cc=geert@linux-m68k.org \
--cc=linux-spi@vger.kernel.org \
--cc=lukas@wunner.de \
/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;
as well as URLs for NNTP newsgroup(s).