mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pelle Nilsson <per.nilsson@xelmo.com>
To: broonie@kernel.org
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	nios2-dev@lists.rocketboards.org
Subject: [PATCH 1/1] spi: altera: Add empty implementation of setup_transfer callback
Date: Thu,  9 Apr 2015 17:03:42 +0200	[thread overview]
Message-ID: <1428591822-24279-2-git-send-email-per.nilsson@xelmo.com> (raw)
In-Reply-To: <1428591822-24279-1-git-send-email-per.nilsson@xelmo.com>

This callback is mandatory since txrx_bufs callback is defined. The lack of
it causes a kernel panic on first SPI transaction.

Signed-off-by: Pelle Nilsson <per.nilsson@xelmo.com>
---
 drivers/spi/spi-altera.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c
index b95010e..6d72b1d 100644
--- a/drivers/spi/spi-altera.c
+++ b/drivers/spi/spi-altera.c
@@ -197,6 +197,11 @@ static irqreturn_t altera_spi_irq(int irq, void *dev)
 	return IRQ_HANDLED;
 }
 
+static int altera_spi_setupxfer(struct spi_device *spi, struct spi_transfer *t)
+{
+	return 0;
+}
+
 static int altera_spi_probe(struct platform_device *pdev)
 {
 	struct altera_spi *hw;
@@ -220,6 +225,7 @@ static int altera_spi_probe(struct platform_device *pdev)
 
 	/* setup the state for the bitbang driver */
 	hw->bitbang.master = master;
+	hw->bitbang.setup_transfer = altera_spi_setupxfer;
 	hw->bitbang.chipselect = altera_spi_chipsel;
 	hw->bitbang.txrx_bufs = altera_spi_txrx;
 
-- 
1.9.1


  reply	other threads:[~2015-04-09 15:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 15:03 [PATCH 0/1] Fix NULL pointer dereference Pelle Nilsson
2015-04-09 15:03 ` Pelle Nilsson [this message]
2015-04-09 15:40   ` [PATCH 1/1] spi: altera: Add empty implementation of setup_transfer callback Mark Brown
2015-04-09 15:50     ` Pelle Nilsson
2015-04-09 16:10       ` Mark Brown
2015-04-13  9:45         ` Pelle Nilsson
2015-04-13 10:08           ` [PATCH] spi: bitbang: Make setup_transfer callback optional Pelle Nilsson
2015-04-14  0:22             ` [Nios2-dev] " Ezequiel Garcia
2015-04-14 13:40             ` [PATCH v2] spi: bitbang: Make setup_transfer() " Pelle Nilsson
2015-04-14 15:36               ` Ezequiel Garcia
2015-04-18 11:00               ` Mark Brown
2015-04-09 15:26 ` [PATCH 0/1] Fix NULL pointer dereference Mark Brown
2015-04-09 15:54 ` [PATCH v2] spi: altera: Add empty implementation of setup_transfer callback Pelle Nilsson
2015-04-09 16:23   ` 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=1428591822-24279-2-git-send-email-per.nilsson@xelmo.com \
    --to=per.nilsson@xelmo.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=nios2-dev@lists.rocketboards.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®