From: Dan Williams <dcbw@redhat.com>
To: Olivier Sobrie <olivier@sobrie.be>
Cc: "John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org, libertas-dev@lists.infradead.org
Subject: Re: [PATCH] libertas: fix errors in functions accessing module registers
Date: Mon, 11 Jul 2011 18:26:24 -0500 [thread overview]
Message-ID: <1310426786.3122.4.camel@dcbw.foobar.com> (raw)
In-Reply-To: <1310209025-16516-1-git-send-email-olivier@sobrie.be>
On Sat, 2011-07-09 at 12:57 +0200, Olivier Sobrie wrote:
> Problems located in the two functions lbs_set_reg() and lbs_get_reg():
> - The offset field of struct cmd_ds_reg_access was not filled in
> - The test on the return code of lbs_cmd_with_response() in function
> lbs_get_reg() was inverted
>
> Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
Acked-by: Dan Williams <dcbw@redhat.com>
> ---
> drivers/net/wireless/libertas/cmd.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
> index 71c8f3f..3e8123c 100644
> --- a/drivers/net/wireless/libertas/cmd.c
> +++ b/drivers/net/wireless/libertas/cmd.c
> @@ -873,6 +873,7 @@ int lbs_get_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 *value)
> memset(&cmd, 0, sizeof(cmd));
> cmd.hdr.size = cpu_to_le16(sizeof(cmd));
> cmd.action = cpu_to_le16(CMD_ACT_GET);
> + cmd.offset = cpu_to_le16(offset);
>
> if (reg != CMD_MAC_REG_ACCESS &&
> reg != CMD_BBP_REG_ACCESS &&
> @@ -882,7 +883,7 @@ int lbs_get_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 *value)
> }
>
> ret = lbs_cmd_with_response(priv, reg, &cmd);
> - if (ret) {
> + if (!ret) {
> if (reg == CMD_BBP_REG_ACCESS || reg == CMD_RF_REG_ACCESS)
> *value = cmd.value.bbp_rf;
> else if (reg == CMD_MAC_REG_ACCESS)
> @@ -915,6 +916,7 @@ int lbs_set_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 value)
> memset(&cmd, 0, sizeof(cmd));
> cmd.hdr.size = cpu_to_le16(sizeof(cmd));
> cmd.action = cpu_to_le16(CMD_ACT_SET);
> + cmd.offset = cpu_to_le16(offset);
>
> if (reg == CMD_BBP_REG_ACCESS || reg == CMD_RF_REG_ACCESS)
> cmd.value.bbp_rf = (u8) (value & 0xFF);
prev parent reply other threads:[~2011-07-11 23:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-09 10:57 [PATCH] libertas: fix errors in functions accessing module registers Olivier Sobrie
2011-07-11 23:26 ` Dan Williams [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=1310426786.3122.4.camel@dcbw.foobar.com \
--to=dcbw@redhat.com \
--cc=libertas-dev@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=olivier@sobrie.be \
/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;
as well as URLs for NNTP newsgroup(s).