public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Parker Newman <parker@finest.io>
Cc: Jiri Slaby <jirislaby@kernel.org>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	Parker Newman <pnewman@connecttech.com>
Subject: Re: [PATCH v3 7/8] serial: exar: add CTI specific setup code
Date: Wed, 17 Apr 2024 15:32:58 +0200	[thread overview]
Message-ID: <2024041700-engraved-bootie-aca5@gregkh> (raw)
In-Reply-To: <20240417091735.17686470@SWDEV2.connecttech.local>

On Wed, Apr 17, 2024 at 09:17:35AM -0400, Parker Newman wrote:
> On Wed, 17 Apr 2024 13:24:20 +0200
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> 
> > On Tue, Apr 16, 2024 at 08:55:34AM -0400, Parker Newman wrote:
> > >  struct exar8250 {
> > >  	unsigned int		nr;
> > > +	unsigned int		osc_freq;
> > > +	struct pci_dev		*pcidev;
> > > +	struct device		*dev;
> >
> > Why do you need both a pci_dev and a device?  Aren't they the same thing
> > here?
> >
> 
> I added dev to make the prints cleaner. I personally prefer:
> 
> 	dev_err(priv->dev, ...);
> to
> 	dev_err(&priv->pcidev->dev, ...);
> 
> or to adding a:
> 	struct device *dev = &priv->pcidev->dev;
> 
> to every function just for printing.
> 
> However, I do understand your point. I can drop dev if you prefer.

Pick one and stick with it, no need for both.  I too like your first
option, and if you never need the pci device pointer, just stick with
"struct dev".  Note, properly reference count it in case you think it
could go away from underneath you (some paths it could, so be careful.)

> > > +static int cti_tristate_disable(struct exar8250 *priv, unsigned int port_num)
> > > +{
> > > +	return _cti_set_tristate(priv, port_num, false);
> > > +}
> >
> > Do you ever call _cti_set_tristate() with "true"?
> >
> 
> Currently no. However, re-enabling tristate via a custom ioctl was a feature in
> our old out-of-tree driver (which was created prior to linux RS485 support).
> 
> I am not sure how it would be activated now, but I left enabling tristate as an
> option in to make it easier down the line when we need it.
> 
> I can add a note to the patch or remove it if you would prefer.

Just remove it for now, no need to ever add code you "might need in the
future", just add that then, when you need it.  Code for what you need
to do now, that makes things simpler and removes extra stuff that you
would have to force others to review :)

thanks,

greg k-h

  reply	other threads:[~2024-04-17 13:33 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 12:55 [PATCH v3 0/8] serial: exar: add Connect Tech serial cards to Exar driver Parker Newman
2024-04-16 12:55 ` [PATCH v3 1/8] serial: exar: adding missing CTI and Exar PCI ids Parker Newman
2024-04-17 11:17   ` Greg Kroah-Hartman
2024-04-16 12:55 ` [PATCH v3 2/8] serial: exar: remove old Connect Tech setup Parker Newman
2024-04-17 11:16   ` Greg Kroah-Hartman
2024-04-16 12:55 ` [PATCH v3 3/8] serial: exar: added a exar_get_nr_ports function Parker Newman
2024-04-17 11:15   ` Greg Kroah-Hartman
2024-04-17 12:21     ` Parker Newman
2024-04-16 12:55 ` [PATCH v3 4/8] serial: exar: add optional board_init function Parker Newman
2024-04-17 11:18   ` Greg Kroah-Hartman
2024-04-16 12:55 ` [PATCH v3 5/8] serial: exar: moved generic_rs485 further up in 8250_exar.c Parker Newman
2024-04-16 12:55 ` [PATCH v3 6/8] serial: exar: add CTI cards to exar_get_nr_ports Parker Newman
2024-04-16 12:55 ` [PATCH v3 7/8] serial: exar: add CTI specific setup code Parker Newman
2024-04-17 11:24   ` Greg Kroah-Hartman
2024-04-17 13:17     ` Parker Newman
2024-04-17 13:32       ` Greg Kroah-Hartman [this message]
2024-04-16 12:55 ` [PATCH v3 8/8] serial: exar: fix: fix crash during shutdown if setup fails Parker Newman
2024-04-17 11:19   ` Greg Kroah-Hartman
2024-04-17 12:24     ` Parker Newman
2024-04-17 13:30       ` Greg Kroah-Hartman
2024-04-17 16:32         ` Parker Newman
2024-04-17 11:24 ` [PATCH v3 0/8] serial: exar: add Connect Tech serial cards to Exar driver Greg Kroah-Hartman
2024-04-17 13:26   ` Parker Newman
2024-04-17 13:49     ` Greg Kroah-Hartman

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=2024041700-engraved-bootie-aca5@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=parker@finest.io \
    --cc=pnewman@connecttech.com \
    /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