linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Rodolfo Giometti <giometti@enneenne.com>
Subject: Re: [PATCH v1 1/1] pps: generators: pps_gen_parport: Switch to use module_parport_driver()
Date: Wed, 16 Jun 2021 17:57:47 +0300	[thread overview]
Message-ID: <CAHp75VeenUQxbaUmA8WXyJkjojnZvzF_PZUZgUPoVVR70+doQg@mail.gmail.com> (raw)
In-Reply-To: <YMoOVrJ1ETVhRr4F@kroah.com>

+Cc: Alexander (I believe he is the author of the original code, sorry if not)

On Wed, Jun 16, 2021 at 5:47 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Wed, Jun 16, 2021 at 05:31:21PM +0300, Andy Shevchenko wrote:
> > Switch to use module_parport_driver() to reduce boilerplate code.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  drivers/pps/generators/pps_gen_parport.c | 44 +++++-------------------
> >  1 file changed, 9 insertions(+), 35 deletions(-)
> >
> > diff --git a/drivers/pps/generators/pps_gen_parport.c b/drivers/pps/generators/pps_gen_parport.c
> > index 6a1af7664f3b..565f99782402 100644
> > --- a/drivers/pps/generators/pps_gen_parport.c
> > +++ b/drivers/pps/generators/pps_gen_parport.c
> > @@ -20,8 +20,6 @@
> >  #include <linux/hrtimer.h>
> >  #include <linux/parport.h>
> >
> > -#define DRVDESC "parallel port PPS signal generator"
> > -
> >  #define SIGNAL               0
> >  #define NO_SIGNAL    PARPORT_CONTROL_STROBE
> >
> > @@ -180,6 +178,11 @@ static void parport_attach(struct parport *port)
> >  {
> >       struct pardev_cb pps_cb;
> >
> > +     if (send_delay > SEND_DELAY_MAX) {
> > +             pr_err("delay value should be not greater then %d\n", SEND_DELAY_MAX);
> > +             return -EINVAL;
>
> Note this is at a later point in time than before, are you sure this is
> ok?

Yes, it doesn't matter when we check the module parameter.

If it's writable we even have more flexibility of changing it at
runtime (when built-in the kernel) after this patch.

> > +     }
> > +
> >       if (attached) {
> >               /* we already have a port */
> >               return;
> > @@ -223,6 +226,8 @@ static void parport_detach(struct parport *port)
> >       hrtimer_cancel(&device.timer);
> >       parport_release(device.pardev);
> >       parport_unregister_device(device.pardev);
> > +
> > +     pr_info("hrtimer avg error is %ldns\n", hrtimer_error);
>
> Why is this line needed?  When drivers work properly, they are quiet.
>
> I know the existing code has it, no reason it needs to stay here, that's
> why we created these macros, to remove the ability for drivers to be
> printing junk like this that they do not need to be printing.

I believe it may be useful for some debugging / statistics. But let's
ask Alexander about this.

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2021-06-16 14:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 14:31 [PATCH v1 1/1] pps: generators: pps_gen_parport: Switch to use module_parport_driver() Andy Shevchenko
2021-06-16 14:44 ` Greg Kroah-Hartman
2021-06-16 14:57   ` Andy Shevchenko [this message]
2021-06-18 15:40     ` Alexander Gordeev
2021-07-12 13:57   ` Andy Shevchenko

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=CAHp75VeenUQxbaUmA8WXyJkjojnZvzF_PZUZgUPoVVR70+doQg@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=agordeev@linux.ibm.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=giometti@enneenne.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@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).