public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: akorolev <alexey.korolev@intel.com>
To: dbrownell@users.sourceforge.net
Cc: dwmw2@infradead.org, linux-kernel@vger.kernel.org, gregkh@suse.de
Subject: [PATCH] SPI FLASH naming conflicts solving
Date: Fri, 01 Jun 2007 18:20:29 +0400	[thread overview]
Message-ID: <46602B2D.7070902@intel.com> (raw)
In-Reply-To: <45FEC94F.8090006@intel.com>

Hi Dawid

I tried to enable SPI flash device in our development platform (Mainstone).
Since the platform driver uses NOR flash device - it includes 
"include/asm-arm/mach/flash.h" file where the structure "flhash_platform 
_data" is defined.
The structure with the same name "flhash_platform _data" is also defined 
in "include/linux/spi/flash.h".
These structures are different - so they cause compile errors.

I attached the fix for this issue. IMHO it's more preferable to resolve 
issue by minor modification of SPI driver than touching all arm platform 
drivers.

=============================
diff -aur orig/drivers/mtd/devices/m25p80.c new/drivers/mtd/devices/m25p80.c
--- orig/drivers/mtd/devices/m25p80.c	2007-06-01 19:06:52.000000000 +0400
+++ new/drivers/mtd/devices/m25p80.c	2007-05-10 16:56:15.000000000 +0400
@@ -423,7 +449,7 @@
  */
 static int __devinit m25p_probe(struct spi_device *spi)
 {
-	struct flash_platform_data	*data;
+	struct spi_flash_platform_data	*data;
 	struct m25p			*flash;
 	struct flash_info		*info;
 	unsigned			i;
diff -aur orig/drivers/mtd/devices/mtd_dataflash.c new/drivers/mtd/devices/mtd_dataflash.c
--- orig/drivers/mtd/devices/mtd_dataflash.c	2007-06-01 19:06:48.000000000 +0400
+++ new/drivers/mtd/devices/mtd_dataflash.c	2007-05-10 14:41:39.000000000 +0400
@@ -457,7 +457,7 @@
 {
 	struct dataflash		*priv;
 	struct mtd_info			*device;
-	struct flash_platform_data	*pdata = spi->dev.platform_data;
+	struct spi_flash_platform_data	*pdata = spi->dev.platform_data;
 
 	priv = kzalloc(sizeof *priv, GFP_KERNEL);
=============================
Could you please take a look at this. The fix is simple. If you don't complain could you please include it. 

Thanks,
Alexey

P/S Also I have a question:
I faced rather strange problem with sending read and write commands  to 
SPI  flash. It works Ok if I reverse 32bit SPI FLASH command
I mean - read/write/erase works if to substitute
    flash->command[0] = OPCODE_SE;
    flash->command[1] = offset >> 16;
    flash->command[2] = offset >> 8;
    flash->command[3] = offset;
for
    flash->command[3] = OPCODE_SE;
    flash->command[2] = offset >> 16;
    flash->command[1] = offset >> 8;
    flash->command[0] = offset;
in file drivers/mtd/devices/m25p80.c

It seems pretty strange and may require more investigation.
I wonder If you have any ideas why it could happen? If anybody tested 
m25p80.c driver on LittleEndian platforms?

  parent reply	other threads:[~2007-06-01 14:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-16 23:45 [PATCH] Linux 2.4.x MTD CFI P30/P33 support Korolev, Alexey
2007-03-17  6:46 ` Willy Tarreau
2007-03-19 17:36   ` akorolev
2007-04-10 17:45     ` akorolev
2007-04-10 20:12       ` Willy Tarreau
     [not found]   ` <45FEC94F.8090006@intel.com>
2007-06-01 14:20     ` akorolev [this message]
2007-06-01 17:01       ` [PATCH] SPI FLASH naming conflicts solving David Brownell

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=46602B2D.7070902@intel.com \
    --to=alexey.korolev@intel.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=dwmw2@infradead.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@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