From: "Noralf Trønnes" <noralf-L59+Z2yzLopAfugRpC6u6w@public.gmane.org>
To: "Stefan Brüns"
<stefan.bruens-vA1bhqPz9FBZXbeN9DUtxg@public.gmane.org>,
linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH 2/2 RESEND] staging/fbtft: use spi_setup instead of direct call to master->setup
Date: Sun, 23 Aug 2015 17:32:02 +0200 [thread overview]
Message-ID: <55D9E772.9070106@tronnes.org> (raw)
In-Reply-To: <4787d5ed-b810-4d3e-b1bc-3a6db745d444-nCK4yPIUxYSnzeKPzzZwVg@public.gmane.org>
Hi Stefan,
fbtft lives in staging/fbtft not drivers/spi, so you need to send it to
the correct list:
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org
See https://github.com/notro/fbtft/wiki/Development
Noralf.
Den 23.08.2015 16:06, skrev Stefan Brüns:
> Avoid a crash, as master->setup may be NULL (e.g. xilinx controller).
> Even if master->setup is set, spi_setup does several compatibility/
> sanity checks which should not be skipped (fixes problems with
> displays/controllers needing emulation for bits_per_word = 9).
>
> Signed-off-by: Stefan Brüns <stefan.bruens-vA1bhqPz9FBZXbeN9DUtxg@public.gmane.org>
> ---
> drivers/staging/fbtft/fb_watterott.c | 4 ++--
> drivers/staging/fbtft/fbtft-core.c | 4 ++--
> drivers/staging/fbtft/flexfb.c | 4 ++--
> 3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/fbtft/fb_watterott.c b/drivers/staging/fbtft/fb_watterott.c
> index 88fb2c0..8eae6ef 100644
> --- a/drivers/staging/fbtft/fb_watterott.c
> +++ b/drivers/staging/fbtft/fb_watterott.c
> @@ -169,7 +169,7 @@ static int init_display(struct fbtft_par *par)
> /* enable SPI interface by having CS and MOSI low during reset */
> save_mode = par->spi->mode;
> par->spi->mode |= SPI_CS_HIGH;
> - ret = par->spi->master->setup(par->spi); /* set CS inactive low */
> + ret = spi_setup(par->spi); /* set CS inactive low */
> if (ret) {
> dev_err(par->info->device, "Could not set SPI_CS_HIGH\n");
> return ret;
> @@ -180,7 +180,7 @@ static int init_display(struct fbtft_par *par)
> par->fbtftops.reset(par);
> mdelay(1000);
> par->spi->mode = save_mode;
> - ret = par->spi->master->setup(par->spi);
> + ret = spi_setup(par->spi);
> if (ret) {
> dev_err(par->info->device, "Could not restore SPI mode\n");
> return ret;
> diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
> index 9cc8141..ba08da3 100644
> --- a/drivers/staging/fbtft/fbtft-core.c
> +++ b/drivers/staging/fbtft/fbtft-core.c
> @@ -1434,12 +1434,12 @@ int fbtft_probe_common(struct fbtft_display *display,
> /* 9-bit SPI setup */
> if (par->spi && display->buswidth == 9) {
> par->spi->bits_per_word = 9;
> - ret = par->spi->master->setup(par->spi);
> + ret = spi_setup(par->spi);
> if (ret) {
> dev_warn(&par->spi->dev,
> "9-bit SPI not available, emulating using 8-bit.\n");
> par->spi->bits_per_word = 8;
> - ret = par->spi->master->setup(par->spi);
> + ret = spi_setup(par->spi);
> if (ret)
> goto out_release;
> /* allocate buffer with room for dc bits */
> diff --git a/drivers/staging/fbtft/flexfb.c b/drivers/staging/fbtft/flexfb.c
> index 2c4ce07..fecf486 100644
> --- a/drivers/staging/fbtft/flexfb.c
> +++ b/drivers/staging/fbtft/flexfb.c
> @@ -440,12 +440,12 @@ static int flexfb_probe_common(struct spi_device *sdev,
> par->fbtftops.write_register = fbtft_write_reg8_bus9;
> par->fbtftops.write_vmem = fbtft_write_vmem16_bus9;
> sdev->bits_per_word = 9;
> - ret = sdev->master->setup(sdev);
> + ret = spi_setup(sdev);
> if (ret) {
> dev_warn(dev,
> "9-bit SPI not available, emulating using 8-bit.\n");
> sdev->bits_per_word = 8;
> - ret = sdev->master->setup(sdev);
> + ret = spi_setup(sdev);
> if (ret)
> goto out_release;
> /* allocate buffer with room for dc bits */
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-08-23 15:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1440338791-30841-1-git-send-email-stefan.bruens@rwth-aachen.de>
[not found] ` <1440338791-30841-1-git-send-email-stefan.bruens-vA1bhqPz9FBZXbeN9DUtxg@public.gmane.org>
2015-08-23 14:06 ` [PATCH 1/2 RESEND] spi: check bits_per_word in spi_setup Stefan Brüns
2015-08-23 14:06 ` [PATCH 2/2 RESEND] staging/fbtft: use spi_setup instead of direct call to master->setup Stefan Brüns
[not found] ` <4787d5ed-b810-4d3e-b1bc-3a6db745d444-nCK4yPIUxYSnzeKPzzZwVg@public.gmane.org>
2015-08-23 15:32 ` Noralf Trønnes [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=55D9E772.9070106@tronnes.org \
--to=noralf-l59+z2yzlopafugrpc6u6w@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=stefan.bruens-vA1bhqPz9FBZXbeN9DUtxg@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.