From: Andi Shyti <andi.shyti@samsung.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Mark Brown <broonie@kernel.org>,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Andi Shyti <andi@etezian.org>
Subject: Re: [PATCH] spi: add spi_sync_single_transfer wrapper for single spi_transfer
Date: Fri, 17 Jun 2016 09:43:11 +0900 [thread overview]
Message-ID: <20160617004311.GA911@samsunx.samsung> (raw)
In-Reply-To: <5762CF88.4060800@metafoo.de>
Hi Lars,
> > The spi_sync_single_transfer function calls spi_sync_transfer
> > with a single spi_transfer element, instead of an array.
>
> So, what's the advantage of using this as opposed to calling
> spi_sync_transfer with a 1 for the number of transfers?
Not much, but it keeps the code a bit nicer to read for those
using spi_sync_transfer with only one spi_transfer. Besides it's
also more understandable what the function itself does and there
would not be any need to jump into the spi_sync_transfer to check
what the number '1' is needed for (for example it's not a boolean
'true' value).
I checked and there are quite many uses of spi_sync_transfer with
only 1 transfer.
Thanks,
Andi
next prev parent reply other threads:[~2016-06-17 0:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 23:40 Andi Shyti
2016-06-16 16:10 ` Lars-Peter Clausen
2016-06-17 0:43 ` Andi Shyti [this message]
2016-06-17 11:34 ` Mark Brown
2016-06-17 11:38 ` Andi Shyti
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=20160617004311.GA911@samsunx.samsung \
--to=andi.shyti@samsung.com \
--cc=andi@etezian.org \
--cc=broonie@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
/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
all inboxes | Powered by JetHome®