linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ellen Wang <ellen-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org>
To: borneo.antonio-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	dbarksdale-2SNLKkHU5xRBDgjK7y7TUQ@public.gmane.org,
	jkosina-AlSwsSmVLrQ@public.gmane.org,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: ellen-qUQiAmfTcIp+XZJcv9eMoEEOCMrvLtNR@public.gmane.org
Subject: [PATCH v1] HID: cp2112: fix I2C_SMBUS_BYTE write
Date: Thu,  9 Jul 2015 22:07:51 -0700	[thread overview]
Message-ID: <1436504871-3676-1-git-send-email-ellen@cumulusnetworks.com> (raw)

When doing an I2C_SMBUS_BYTE write (one byte write, no address),
the data to be written is in "command" not "data->byte".
---
 drivers/hid/hid-cp2112.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index a3703b8..7afc3fc 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -606,7 +606,7 @@ static int cp2112_xfer(struct i2c_adapter *adap, u16 addr,
 		if (I2C_SMBUS_READ == read_write)
 			count = cp2112_read_req(buf, addr, read_length);
 		else
-			count = cp2112_write_req(buf, addr, data->byte, NULL,
+			count = cp2112_write_req(buf, addr, command, NULL,
 						 0);
 		break;
 	case I2C_SMBUS_BYTE_DATA:
-- 
1.9.1

             reply	other threads:[~2015-07-10  5:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10  5:07 Ellen Wang [this message]
2015-07-13 11:20 ` [PATCH v1] HID: cp2112: fix I2C_SMBUS_BYTE write Jiri Kosina
     [not found]   ` <alpine.LNX.2.00.1507131320060.7522-ztGlSCb7Y1iN3ZZ/Hiejyg@public.gmane.org>
2015-07-13 22:28     ` Ellen Wang

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=1436504871-3676-1-git-send-email-ellen@cumulusnetworks.com \
    --to=ellen-quqiamftcip+xzjcv9emoeeocmrvltnr@public.gmane.org \
    --cc=borneo.antonio-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=dbarksdale-2SNLKkHU5xRBDgjK7y7TUQ@public.gmane.org \
    --cc=jkosina-AlSwsSmVLrQ@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.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;
as well as URLs for NNTP newsgroup(s).