From: Octavian Purdila <octavian.purdila@intel.com>
To: Joe Perches <joe@perches.com>
Cc: Octavian Purdila <octavian.purdila@intel.com>,
Greg KH <gregkh@linuxfoundation.org>,
Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>,
wsa@the-dreams.de, sameo@linux.intel.com,
Lee Jones <lee.jones@linaro.org>, Arnd Bergmann <arnd@arndb.de>,
Johan Hovold <johan@kernel.org>,
Daniel Baluta <daniel.baluta@intel.com>,
Laurentiu Palcu <laurentiu.palcu@intel.com>,
linux-usb@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH v9 1/4] mfd: add support for Diolan DLN-2 devices
Date: Tue, 28 Oct 2014 15:25:36 +0200 [thread overview]
Message-ID: <CAMoF9u3DDPFXHKUmmPhAEXiqV3p5TaMfvQU-_HTmLO6amDxntw@mail.gmail.com> (raw)
In-Reply-To: <1414429069.8884.10.camel@perches.com>
On Mon, Oct 27, 2014 at 6:57 PM, Joe Perches <joe@perches.com> wrote:
> On Mon, 2014-10-27 at 18:31 +0200, Octavian Purdila wrote:
>> This patch implements the USB part of the Diolan USB-I2C/SPI/GPIO
>> Master Adapter DLN-2. Details about the device can be found here:
>
> trivia:
>
Thanks for the review Joe.
>> diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
> []
>> +static int _dln2_transfer(struct dln2_dev *dln2, u16 handle, u16 cmd,
>> + const void *obuf, unsigned obuf_len,
>> + void *ibuf, unsigned *ibuf_len)
>> +{
>> + int ret = 0;
>> + int rx_slot;
>> + struct dln2_response *rsp;
>> + struct dln2_rx_context *rxc;
>> + struct device *dev = &dln2->interface->dev;
>> + const int timeout = DLN2_USB_TIMEOUT * HZ / 1000;
>
> unsigned long timeout?
>
Ok.
> []
>
>> + ret = wait_for_completion_interruptible_timeout(&rxc->done, timeout);
>> + if (ret <= 0) {
>> + if (!ret)
>> + ret = -ETIMEDOUT;
>> + goto out_free_rx_slot;
>> + }
>
> []
I think you forgot to add your comments here?
>
>> +static int dln2_print_serialno(struct dln2_dev *dln2)
>> +{
>> + int ret;
>> + __le32 serial_no;
>> + int len = sizeof(serial_no);
>> + struct device *dev = &dln2->interface->dev;
>> +
>> + ret = _dln2_transfer(dln2, DLN2_HANDLE_CTRL, CMD_GET_DEVICE_SN, NULL, 0,
>> + &serial_no, &len);
>> + if (ret < 0)
>> + return ret;
>> + if (len < sizeof(serial_no))
>> + return -EREMOTEIO;
>> +
>> + dev_info(dev, "Diolan DLN2 serial 0x%x\n", le32_to_cpu(serial_no));
>
> why a hex serial #?
>
Good point, I will switch it to decimal.
next prev parent reply other threads:[~2014-10-28 13:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-27 16:31 [PATCH v9 0/4] mfd: add support for Diolan DLN-2 Octavian Purdila
[not found] ` <1414427472-4100-1-git-send-email-octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-10-27 16:31 ` [PATCH v9 1/4] mfd: add support for Diolan DLN-2 devices Octavian Purdila
2014-10-27 16:57 ` Joe Perches
2014-10-28 13:25 ` Octavian Purdila [this message]
2014-11-05 15:48 ` Johan Hovold
2014-10-27 16:31 ` [PATCH v9 4/4] gpio: add support for the Diolan DLN-2 USB GPIO driver Octavian Purdila
[not found] ` <1414427472-4100-5-git-send-email-octavian.purdila-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-05 15:45 ` Johan Hovold
2014-10-27 16:31 ` [PATCH v9 2/4] i2c: add support for Diolan DLN-2 USB-I2C adapter Octavian Purdila
2014-11-05 15:49 ` Johan Hovold
2014-10-27 16:31 ` [PATCH v9 3/4] gpiolib: add irq_not_threaded flag to gpio_chip Octavian Purdila
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=CAMoF9u3DDPFXHKUmmPhAEXiqV3p5TaMfvQU-_HTmLO6amDxntw@mail.gmail.com \
--to=octavian.purdila@intel.com \
--cc=arnd@arndb.de \
--cc=daniel.baluta@intel.com \
--cc=gnurou@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=johan@kernel.org \
--cc=laurentiu.palcu@intel.com \
--cc=lee.jones@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=wsa@the-dreams.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;
as well as URLs for NNTP newsgroup(s).