lkml.org 
[lkml]   [2014]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv2] usb: gadget: serial: replace hardcoded ttyGS with PREFIX
On Tue, 1 Jul 2014 09:31:49 +0200
Richard Leitner <richard.leitner@skidata.com> wrote:

> On Mon, 30 Jun 2014 07:45:43 -0700
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
> > > > > > From: Of Richard Leitner
> > > > > > > Replaces all hardcoded ttyGS strings with the PREFIX macro.
> > > > > > > Due to the fact the strings are spread over different source files the
> > > > > > > PREFIX definition is moved to u_serial.h
> > > > > >
> > > > > > Lots of changes like:
> > > > > > > - DBG(cdev, "acm ttyGS%d completion, err %d\n",
> > > > > > > - acm->port_num, req->status);
> > > > > > > + DBG(cdev, "acm %s%d completion, err %d\n",
> > > > > > > + PREFIX, acm->port_num, req->status);
> > > > > >
> >
> > Use the "proper" debug macros that the kernel provides you (i.e.
> > dev_dbg() and family) and then you don't need to put the string in there
> > at all, the kernel will do it automatically for you, in the correct
> > format, so that all userspace tools can properly track what is going on.
> >
> > So please remove the horrid DBG() macro entirely.
I'll prepare a patch for that...

But that doesn't solve my original problem with the hardcoded "ttyGS"...

>
> [...] where do I get the device struct for the ttyGS from?

In u_serial with something like:

- pr_debug("gs_open: ttyGS%d (%p,%p)\n", port->port_num, tty, file);
+ pr_debug("gs_open: %s (%p,%p)\n", dev_name(tty->dev), tty, file);

Or is there a better approach?

What will be a good solution for f_acm/f_obex instead of PREFIX? Or should PREFIX be renamed and used?

Thanks for your help and patience!

regards,
richard


\
 
 \ /
  Last update: 2014-07-01 18:21    [W:0.060 / U:0.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site