All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu it <matthieu.it@gmail.com>
To: linux-mtd@lists.infradead.org
Subject: finfo_uaddr in jedec_probe.c
Date: Tue, 13 Sep 2005 18:18:37 +0200	[thread overview]
Message-ID: <90c5722505091309184e49ac08@mail.gmail.com> (raw)

Hello, 

I have some difficulties to understand the way the function
finfo_uaddr is working, especially for probing non x8 flash :

static inline __u8 finfo_uaddr(const struct amd_flash_info *finfo, int
device_type)
{
	int uaddr_idx;
	__u8 uaddr = MTD_UADDR_NOT_SUPPORTED;

	switch ( device_type ) {
	case CFI_DEVICETYPE_X8:  uaddr_idx = 0; break;
	case CFI_DEVICETYPE_X16: uaddr_idx = 1; break;
	case CFI_DEVICETYPE_X32: uaddr_idx = 2; break;
	default:
		printk(KERN_NOTICE "MTD: %s(): unknown device_type %d\n",
		       __func__, device_type);
		goto uaddr_done;
	}

	uaddr = finfo->uaddr[uaddr_idx];

	if (uaddr != MTD_UADDR_NOT_SUPPORTED ) {
		/* ASSERT("The unlock addresses for non-8-bit mode
		   are bollocks. We don't really need an array."); */
		uaddr = finfo->uaddr[0];
	}

 uaddr_done:
	return uaddr;
}

I would have replaced the line : 
if (uaddr != MTD_UADDR_NOT_SUPPORTED )
by 
if (uaddr == MTD_UADDR_NOT_SUPPORTED )

(at least, it makes my 2.6.12 kernel recognising the flash I have on
my board, with correct uaddr values in the table).

but it seems so strange that I may have missed something...

Can someone told me if I am wrong ? 

Regards,

                 reply	other threads:[~2005-09-13 16:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=90c5722505091309184e49ac08@mail.gmail.com \
    --to=matthieu.it@gmail.com \
    --cc=linux-mtd@lists.infradead.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.