linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 1/5] media: rc: nuvoton: remove nvt_open and nvt_close
Date: Fri, 18 Nov 2016 17:02:53 -0200	[thread overview]
Message-ID: <20161118170253.78907131@vento.lan> (raw)
In-Reply-To: <07318f26-3d54-d01e-c5eb-880acc0e04a4@gmail.com>

Em Tue, 25 Oct 2016 21:23:16 +0200
Heiner Kallweit <hkallweit1@gmail.com> escreveu:

> What is done in nvt_probe was done in nvt_probe already
> (in nvt_cir_ldev_init and nvt_cir_regs_init, both called from
> nvt_probe). It's the same with nvt_close, it's covered by nvt_remove.
> Therefore I don't see any benefit in implementing the open and close
> hooks at all and both functions can be removed.

Hmm... Wouldn't make sense to do the reverse, e. g. only enable the
hardware when it is opened, as otherwise it would be generating
IRQs with IR scan codes without anyone actually listening to them?

> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/media/rc/nuvoton-cir.c | 35 -----------------------------------
>  1 file changed, 35 deletions(-)
> 
> diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
> index 3df3bd9..37fce7b 100644
> --- a/drivers/media/rc/nuvoton-cir.c
> +++ b/drivers/media/rc/nuvoton-cir.c
> @@ -964,39 +964,6 @@ static void nvt_disable_cir(struct nvt_dev *nvt)
>  	nvt_disable_logical_dev(nvt, LOGICAL_DEV_CIR);
>  }
>  
> -static int nvt_open(struct rc_dev *dev)
> -{
> -	struct nvt_dev *nvt = dev->priv;
> -	unsigned long flags;
> -
> -	spin_lock_irqsave(&nvt->nvt_lock, flags);
> -
> -	/* set function enable flags */
> -	nvt_cir_reg_write(nvt, CIR_IRCON_TXEN | CIR_IRCON_RXEN |
> -			  CIR_IRCON_RXINV | CIR_IRCON_SAMPLE_PERIOD_SEL,
> -			  CIR_IRCON);
> -
> -	/* clear all pending interrupts */
> -	nvt_cir_reg_write(nvt, 0xff, CIR_IRSTS);
> -
> -	/* enable interrupts */
> -	nvt_set_cir_iren(nvt);
> -
> -	spin_unlock_irqrestore(&nvt->nvt_lock, flags);
> -
> -	/* enable the CIR logical device */
> -	nvt_enable_logical_dev(nvt, LOGICAL_DEV_CIR);
> -
> -	return 0;
> -}
> -
> -static void nvt_close(struct rc_dev *dev)
> -{
> -	struct nvt_dev *nvt = dev->priv;
> -
> -	nvt_disable_cir(nvt);
> -}
> -
>  /* Allocate memory, probe hardware, and initialize everything */
>  static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
>  {
> @@ -1075,8 +1042,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
>  	rdev->priv = nvt;
>  	rdev->driver_type = RC_DRIVER_IR_RAW;
>  	rdev->allowed_protocols = RC_BIT_ALL;
> -	rdev->open = nvt_open;
> -	rdev->close = nvt_close;
>  	rdev->tx_ir = nvt_tx_ir;
>  	rdev->s_tx_carrier = nvt_set_tx_carrier;
>  	rdev->input_name = "Nuvoton w836x7hg Infrared Remote Transceiver";


-- 
Thanks,
Mauro

      reply	other threads:[~2016-11-18 19:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25 19:23 [PATCH 1/5] media: rc: nuvoton: remove nvt_open and nvt_close Heiner Kallweit
2016-11-18 19:02 ` Mauro Carvalho Chehab [this message]

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=20161118170253.78907131@vento.lan \
    --to=mchehab@osg.samsung.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-media@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).