linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Mark Brown <broonie@kernel.org>,
	Grant Likely <grant.likely@linaro.org>,
	spi-devel-general@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	device-drivers-devel@blackfin.uclinux.org,
	Mike Frysinger <vapier@gentoo.org>
Subject: Re: [PATCH 2/2] spi: convert drivers to use bits_per_word_mask
Date: Tue, 09 Jul 2013 17:47:04 +0200	[thread overview]
Message-ID: <51DC3078.5090602@monstr.eu> (raw)
In-Reply-To: <1369190195-14598-2-git-send-email-swarren@wwwdotorg.org>

[-- Attachment #1: Type: text/plain, Size: 2131 bytes --]

> diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
> index e1d7696..f321bf9 100644
> --- a/drivers/spi/spi-xilinx.c
> +++ b/drivers/spi/spi-xilinx.c
> @@ -232,21 +232,6 @@ static int xilinx_spi_setup_transfer(struct spi_device *spi,
>  	return 0;
>  }
>  
> -static int xilinx_spi_setup(struct spi_device *spi)
> -{
> -	/* always return 0, we can not check the number of bits.
> -	 * There are cases when SPI setup is called before any driver is
> -	 * there, in that case the SPI core defaults to 8 bits, which we
> -	 * do not support in some cases. But if we return an error, the
> -	 * SPI device would not be registered and no driver can get hold of it
> -	 * When the driver is there, it will call SPI setup again with the
> -	 * correct number of bits per transfer.
> -	 * If a driver setups with the wrong bit number, it will fail when
> -	 * it tries to do a transfer
> -	 */
> -	return 0;
> -}
> -
>  static void xilinx_spi_fill_tx_fifo(struct xilinx_spi *xspi)
>  {
>  	u8 sr;
> @@ -377,7 +362,6 @@ struct spi_master *xilinx_spi_init(struct device *dev, struct resource *mem,
>  	xspi->bitbang.chipselect = xilinx_spi_chipselect;
>  	xspi->bitbang.setup_transfer = xilinx_spi_setup_transfer;
>  	xspi->bitbang.txrx_bufs = xilinx_spi_txrx_bufs;
> -	xspi->bitbang.master->setup = xilinx_spi_setup;
>  	init_completion(&xspi->done);
>  
>  	if (!request_mem_region(mem->start, resource_size(mem),
> 

This part of this patch is breaking xilinx spi driver because when
spi_bitbang_start is called it goes through some if else...
and because bitbang->txrx_bufs is defined
it end up in this code
	} else if (!master->setup) {
		return -EINVAL;
	}

Probably the best solution is just revert this part of patch.
Mark: What do you think?

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  parent reply	other threads:[~2013-07-09 15:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  2:36 [PATCH 1/2] spi: introduce macros to set bits_per_word_mask Stephen Warren
     [not found] ` <1369190195-14598-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-05-22  2:36   ` [PATCH 2/2] spi: convert drivers to use bits_per_word_mask Stephen Warren
2013-05-24 17:16     ` H Hartley Sweeten
2013-05-29 19:49     ` Mark Brown
     [not found]     ` <1369190195-14598-2-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-05-31  8:45       ` Arnd Bergmann
2013-05-31 16:10         ` Stephen Warren
     [not found]           ` <51A8CB87.80201-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-05-31 21:23             ` Arnd Bergmann
2013-07-09 15:47     ` Michal Simek [this message]
2013-07-09 15:50       ` Stephen Warren
2013-07-09 21:49       ` Mark Brown
2013-07-09 21:56         ` Mark Brown
2013-05-22 15:58 ` [PATCH 1/2] spi: introduce macros to set bits_per_word_mask 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=51DC3078.5090602@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=broonie@kernel.org \
    --cc=device-drivers-devel@blackfin.uclinux.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=swarren@wwwdotorg.org \
    --cc=vapier@gentoo.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;
as well as URLs for NNTP newsgroup(s).