driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Christian.Gromm@microchip.com
Cc: driverdev-devel@linuxdriverproject.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH RFC] drivers: most: add USB adapter driver
Date: Mon, 11 May 2020 18:33:46 +0200	[thread overview]
Message-ID: <20200511163346.GA2236392@kroah.com> (raw)
In-Reply-To: <266714a09283d7b5cc9f0720415db7e86bf18387.camel@microchip.com>

On Mon, May 11, 2020 at 02:46:58PM +0000, Christian.Gromm@microchip.com wrote:
> On Mon, 2020-05-11 at 13:47 +0200, Greg KH wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you
> > know the content is safe
> > 
> > On Mon, May 11, 2020 at 11:51:15AM +0200, Christian Gromm wrote:
> > > This patch adds the MOST USB adapter driver to the stable branch.
> > > This is
> > > a follow-up to commit <b276527>.
> > 
> > I do not understand the "a follow-up..." sentance.  Always use the
> > format of:
> >         b27652753918 ("staging: most: move core files out of the
> > staging area")
> > when writing kernel commits in changelogs.
> > 
> > Also, that commit doesn't really mean anything here, this is a
> > stand-alone driver for the most subsystem.  This changelog needs
> > work.
> 
> Purpose was sharing the information that this is patch is
> only one part of moving the complete driver stack. That a
> first step has alread been done and others are to follow.
> But you're probably right and nobody realy needs to know.
> 
> I'll skip this.
> 
> > 
> > > Signed-off-by: Christian Gromm <christian.gromm@microchip.com>
> > > ---
> > >  drivers/most/Kconfig          |    6 +
> > >  drivers/most/Makefile         |    2 +
> > >  drivers/most/usb/Kconfig      |   14 +
> > >  drivers/most/usb/Makefile     |    4 +
> > >  drivers/most/usb/usb.c        | 1262
> > > +++++++++++++++++++++++++++++++++++++++++
> > 
> > Why not just call this file most-usb.c so you don't have to do the
> > 2-step Makefile work.  Also, why a whole subdir for a single .c file?
> 
> To keep the staging layout.

No need to do that, this is a new layout :)

> > > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > 
> > You shouldn't need any pr_*() calls because this is a driver and you
> > always have access to the struct device * it controls.  So drop this
> > and
> > fix up the remaining pr_*() calls to be dev_*() instead.
> 
> There are helper functions that actually don't have access to the
> struct device and it felt like an overhead to pass the device
> pointer just for logging purposes.

pr_* calls show almost nothing when it comes to the actual device/driver
being affected.  That's why the dev_*() functions are there, please use
them.

> > > +/**
> > > + * struct most_dci_obj - Direct Communication Interface
> > > + * @kobj:position in sysfs
> > > + * @usb_device: pointer to the usb device
> > > + * @reg_addr: register address for arbitrary DCI access
> > > + */
> > > +struct most_dci_obj {
> > > +     struct device dev;
> > 
> > Wait, why is a USB driver creating something with a separate struct
> > device embedded in it?  Shouldn't the most core handle stuff like
> > this?
> 
> The driver adds an ABI interface that belongs to USB only. This keeps
> the core generic.

So this same type of thing is also needed in the other bus controllers
(serial, i2c, etc.)?

Creating a new device implies it lives on a bus, and almost always the
bus code for creating/managing that code lives in a single place, not in
the individual drivers.  Why doesn't the most core handle this?  What
does the most core do?  :)


> > > +static DEVICE_ATTR(arb_address, 0644, value_show, value_store);
> > > +static DEVICE_ATTR(arb_value, 0644, value_show, value_store);
> > 
> > Loads of sysfs files with no documentation for them?
> > 
> 
> see driver/staging/most/Documentation

Add it as part of this patch series, as you are moving these sysfs files
into the "real" part of the kernel and belong out of drivers/staging/

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2020-05-12  8:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-11  9:51 [PATCH RFC] drivers: most: add USB adapter driver Christian Gromm
2020-05-11 11:47 ` Greg KH
2020-05-11 14:46   ` Christian.Gromm
2020-05-11 16:33     ` Greg KH [this message]
2020-05-12  9:58       ` Christian.Gromm
2020-05-11 14:25 ` Randy Dunlap

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=20200511163346.GA2236392@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Christian.Gromm@microchip.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=linux-usb@vger.kernel.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).