summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorLeonardo Brás <leobras.c@gmail.com>2018-08-07 21:29:04 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-08 14:23:16 +0200
commit5bfac06f3e21669a1109fe05bb457adac711312a (patch)
tree5556e765460cb825614b7cb822b173674eb4b291 /drivers/staging
parentd9932c8be094b2891c50348513bfeae578cd5e1e (diff)
downloadlinux-5bfac06f3e21669a1109fe05bb457adac711312a.tar.gz
linux-5bfac06f3e21669a1109fe05bb457adac711312a.tar.bz2
linux-5bfac06f3e21669a1109fe05bb457adac711312a.zip
staging: fbtft: Removes one nesting level to help readability - Style
This nesting level was removed to improve readability. Signed-off-by: Leonardo Brás <leobras.c@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/fbtft/flexfb.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/staging/fbtft/flexfb.c b/drivers/staging/fbtft/flexfb.c
index a2b4164ce5e4..2af474469e7d 100644
--- a/drivers/staging/fbtft/flexfb.c
+++ b/drivers/staging/fbtft/flexfb.c
@@ -679,19 +679,22 @@ static int flexfb_probe_common(struct spi_device *sdev,
if (par->spi->master->bits_per_word_mask
& SPI_BPW_MASK(9)) {
par->spi->bits_per_word = 9;
- } else {
- dev_warn(dev,
- "9-bit SPI not available, emulating using 8-bit.\n");
- /* allocate buffer with room for dc bits */
- par->extra = devm_kzalloc(par->info->device,
- par->txbuf.len + (par->txbuf.len / 8) + 8,
- GFP_KERNEL);
- if (!par->extra) {
- ret = -ENOMEM;
- goto out_release;
- }
- par->fbtftops.write = fbtft_write_spi_emulate_9;
+ break;
}
+
+ dev_warn(dev,
+ "9-bit SPI not available, emulating using 8-bit.\n");
+ /* allocate buffer with room for dc bits */
+ par->extra = devm_kzalloc(par->info->device,
+ par->txbuf.len
+ + (par->txbuf.len / 8) + 8,
+ GFP_KERNEL);
+ if (!par->extra) {
+ ret = -ENOMEM;
+ goto out_release;
+ }
+ par->fbtftops.write = fbtft_write_spi_emulate_9;
+
break;
default:
dev_err(dev,