From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] cs8900 assign dev->priv before using it
Date: Thu, 29 Oct 2009 10:05:05 -0700 [thread overview]
Message-ID: <4AE9CB41.8090404@gmail.com> (raw)
In-Reply-To: <1256806167-28005-1-git-send-email-zetalabs@gmail.com>
Hello Hui,
Hui.Tang wrote:
> cs8900_get_enetaddr() call get_reg_init_bus(), which will use dev->priv in CONFIG_CS8900_BUS16 config, so we should assign dev->priv before using it.
>
> ---
> drivers/net/cs8900.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c
> index 587f7f6..962b74c 100644
> --- a/drivers/net/cs8900.c
> +++ b/drivers/net/cs8900.c
> @@ -320,12 +320,12 @@ int cs8900_initialize(u8 dev_num, int base_addr)
> }
> memset(priv, 0, sizeof(*priv));
> priv->regs = (struct cs8900_regs *)base_addr;
> + dev->priv = priv;
>
> /* Load MAC address from EEPROM */
> cs8900_get_enetaddr(dev);
>
> dev->iobase = base_addr;
> - dev->priv = priv;
> dev->init = cs8900_init;
> dev->halt = cs8900_halt;
> dev->send = cs8900_send;
>
Thanks for catching this. I'd prefer to move the
'cs8900_get_enetaddr() call to below all the function pointer
assignments. In the interest of getting this bug fix in the current
release, I'll just modify your patch and apply it.
Next time please remember your signed-off-by line.
regards,
Ben
next prev parent reply other threads:[~2009-10-29 17:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-29 8:49 [U-Boot] [PATCH] cs8900 assign dev->priv before using it Hui.Tang
2009-10-29 17:05 ` Ben Warren [this message]
2009-10-30 4:13 ` Hui Tang
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=4AE9CB41.8090404@gmail.com \
--to=biggerbadderben@gmail.com \
--cc=u-boot@lists.denx.de \
/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