From: Greg KH <gregkh@linuxfoundation.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Richard Leitner <richard.leitner@skidata.com>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, robh+dt@kernel.org,
mark.rutland@arm.com, stern@rowland.harvard.edu, dev@g0hl1n.net
Subject: Re: [PATCH v4] usb: misc: add USB251xB/xBi Hi-Speed Hub Controller Driver
Date: Wed, 8 Feb 2017 14:59:57 +0100 [thread overview]
Message-ID: <20170208135957.GA916@kroah.com> (raw)
In-Reply-To: <1486560068.2133.395.camel@linux.intel.com>
On Wed, Feb 08, 2017 at 03:21:08PM +0200, Andy Shevchenko wrote:
> On Wed, 2017-02-08 at 09:52 +0100, Richard Leitner wrote:
> > From: Richard Leitner <dev@g0hl1n.net>
>
> If you want to fix the above you have to fix your Git configuration.
>
>
> > This patch adds a driver for configuration of the Microchip
> > USB251xB/xBi
> > USB 2.0 hub controller series with USB 2.0 upstream connectivity,
> > SMBus
> > configuration interface and two to four USB 2.0 downstream ports.
> >
> > Furthermore add myself as a maintainer for this driver.
> >
> > The datasheet can be found at the manufacturers website, see [1]. All
> > device-tree exposed configuration features have been tested on a i.MX6
> > platform with a USB2512B hub.
>
> > +++ b/drivers/usb/misc/usb251xb.c
> > @@ -0,0 +1,674 @@
>
> > +#include <linux/i2c.h>
> > +#include <linux/gpio.h>
> > +#include <linux/delay.h>
> > +#include <linux/slab.h>
> > +#include <linux/module.h>
> > +#include <linux/of_gpio.h>
> > +#include <linux/of_device.h>
> > +#include <linux/nls.h>
>
> Alphabetical order?
Ick, no, who cares, really. It's whatever order the author wants, don't
be so picky.
> > +#define DRIVER_NAME "usb251xb"
> > +#define DRIVER_DESC "Microchip USB 2.0 Hi-Speed Hub Controller"
> > +#define DRIVER_VERSION "1.0"
>
> Is it my MUA, or all above indentations are broken?
What do you mean?
> > +static inline void set_bit_in_byte(u8 bit, u8 *val)
> > +{
> > + if (bit < 8)
> > + *val |= (1 << bit);
> > +}
> > +
> > +static inline void clr_bit_in_byte(u8 bit, u8 *val)
> > +{
> > + if (bit < 8)
> > + *val &= ~(1 << bit);
> > +}
>
> Above doesn't make much sense. Why not to use
>
> | BIT(bit)
>
> and
>
> & ~BIT(bit)
>
> in place?
I thought we already had functions to do this for you. Don't write new
ones "by hand" either wya.
> > + /* the first data byte transferred tells the hub how
> > many data
> > + * bytes will follow (byte count)
> > + */
>
> I'm not sure this is good formatted comment for USB subsystem.
Looks fine to me, why do you think it is incorrect?
> > + /* the following parameters are currently not exposed to
> > devicetree, but
> > + * may be as soon as needed
> > + */
>
> Style of multi-line comment.
Nope, it's fine.
> > +#else /* CONFIG_OF */
> > +static int usb251xb_get_ofdata(struct usb251xb *hub,
> > + struct usb251xb_data *data)
> > +{
> > + return 0;
> > +}
> > +#endif /* CONFIG_OF */
>
> I don't think it's a good idea to have those ugly #ifdef.
How can it be removed?
> > +static int usb251xb_probe(struct usb251xb *hub)
> > +{
> > + struct device *dev = hub->dev;
> > + struct device_node *np = dev->of_node;
> > + const struct of_device_id *of_id =
> > of_match_device(usb251xb_of_match,
> > + dev);
> > + int err;
> > +
>
> > + dev_info(dev, DRIVER_DESC " " DRIVER_NAME "\n");
>
> Useless.
Agreed.
thanks,
greg k-h
next prev parent reply other threads:[~2017-02-08 13:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 8:52 [PATCH v4] usb: misc: add USB251xB/xBi Hi-Speed Hub Controller Driver Richard Leitner
2017-02-08 8:58 ` Richard Leitner
[not found] ` <ade53079-b4ac-5290-6d05-0d71ddc62ad0-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>
2017-02-08 13:04 ` Greg KH
[not found] ` <1486543976-28006-1-git-send-email-richard.leitner-WcANXNA0UjBBDgjK7y7TUQ@public.gmane.org>
2017-02-08 13:21 ` Andy Shevchenko
2017-02-08 13:59 ` Greg KH [this message]
2017-02-08 15:17 ` Richard Leitner
2017-02-08 16:40 ` Andy Shevchenko
[not found] ` <1486572009.2133.406.camel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-02-08 18:45 ` Richard Leitner
[not found] ` <80e533b6-4eb3-0019-fe18-82dd0d7aaa1c-M/VWbR8SM2SsTnJN9+BGXg@public.gmane.org>
2017-02-08 19:20 ` Andy Shevchenko
[not found] ` <1486581644.2133.409.camel-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-02-08 20:03 ` Richard Leitner
[not found] ` <3902c4a9-cd1d-23fe-df75-127b5cab61ad-M/VWbR8SM2SsTnJN9+BGXg@public.gmane.org>
2017-02-08 20:16 ` Andy Shevchenko
2017-02-09 8:44 ` Richard Leitner
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=20170208135957.GA916@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dev@g0hl1n.net \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=richard.leitner@skidata.com \
--cc=robh+dt@kernel.org \
--cc=stern@rowland.harvard.edu \
/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).