* [PATCH 1/5] media: rc: nuvoton: remove nvt_open and nvt_close
@ 2016-10-25 19:23 Heiner Kallweit
2016-11-18 19:02 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2016-10-25 19:23 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: linux-media
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.
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";
--
2.10.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/5] media: rc: nuvoton: remove nvt_open and nvt_close
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
0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2016-11-18 19:02 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: linux-media
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-18 19:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).