Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b17ec78a authored by Kees Cook's avatar Kees Cook Committed by Mauro Carvalho Chehab
Browse files

media: rc: Convert timers to use timer_setup()



In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: "Antti Seppälä" <a.seppala@gmail.com>
Cc: Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David Härdeman" <david@hardeman.nu>
Cc: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 715e3f4d
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -670,9 +670,9 @@ static void ene_tx_sample(struct ene_device *dev)
}
}


/* timer to simulate tx done interrupt */
/* timer to simulate tx done interrupt */
static void ene_tx_irqsim(unsigned long data)
static void ene_tx_irqsim(struct timer_list *t)
{
{
	struct ene_device *dev = (struct ene_device *)data;
	struct ene_device *dev = from_timer(dev, t, tx_sim_timer);
	unsigned long flags;
	unsigned long flags;


	spin_lock_irqsave(&dev->hw_lock, flags);
	spin_lock_irqsave(&dev->hw_lock, flags);
@@ -1045,8 +1045,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)


	if (!dev->hw_learning_and_tx_capable && txsim) {
	if (!dev->hw_learning_and_tx_capable && txsim) {
		dev->hw_learning_and_tx_capable = true;
		dev->hw_learning_and_tx_capable = true;
		setup_timer(&dev->tx_sim_timer, ene_tx_irqsim,
		timer_setup(&dev->tx_sim_timer, ene_tx_irqsim, 0);
						(long unsigned int)dev);
		pr_warn("Simulation of TX activated\n");
		pr_warn("Simulation of TX activated\n");
	}
	}


+3 −3
Original line number Original line Diff line number Diff line
@@ -137,9 +137,9 @@ static void igorplugusb_cmd(struct igorplugusb *ir, int cmd)
		dev_err(ir->dev, "submit urb failed: %d", ret);
		dev_err(ir->dev, "submit urb failed: %d", ret);
}
}


static void igorplugusb_timer(unsigned long data)
static void igorplugusb_timer(struct timer_list *t)
{
{
	struct igorplugusb *ir = (struct igorplugusb *)data;
	struct igorplugusb *ir = from_timer(ir, t, timer);


	igorplugusb_cmd(ir, GET_INFRACODE);
	igorplugusb_cmd(ir, GET_INFRACODE);
}
}
@@ -174,7 +174,7 @@ static int igorplugusb_probe(struct usb_interface *intf,


	ir->dev = &intf->dev;
	ir->dev = &intf->dev;


	setup_timer(&ir->timer, igorplugusb_timer, (unsigned long)ir);
	timer_setup(&ir->timer, igorplugusb_timer, 0);


	ir->request.bRequest = GET_INFRACODE;
	ir->request.bRequest = GET_INFRACODE;
	ir->request.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN;
	ir->request.bRequestType = USB_TYPE_VENDOR | USB_DIR_IN;
+6 −7
Original line number Original line Diff line number Diff line
@@ -867,9 +867,9 @@ static void img_ir_handle_data(struct img_ir_priv *priv, u32 len, u64 raw)
}
}


/* timer function to end waiting for repeat. */
/* timer function to end waiting for repeat. */
static void img_ir_end_timer(unsigned long arg)
static void img_ir_end_timer(struct timer_list *t)
{
{
	struct img_ir_priv *priv = (struct img_ir_priv *)arg;
	struct img_ir_priv *priv = from_timer(priv, t, hw.end_timer);


	spin_lock_irq(&priv->lock);
	spin_lock_irq(&priv->lock);
	img_ir_end_repeat(priv);
	img_ir_end_repeat(priv);
@@ -881,9 +881,9 @@ static void img_ir_end_timer(unsigned long arg)
 * cleared when invalid interrupts were generated due to a quirk in the
 * cleared when invalid interrupts were generated due to a quirk in the
 * img-ir decoder.
 * img-ir decoder.
 */
 */
static void img_ir_suspend_timer(unsigned long arg)
static void img_ir_suspend_timer(struct timer_list *t)
{
{
	struct img_ir_priv *priv = (struct img_ir_priv *)arg;
	struct img_ir_priv *priv = from_timer(priv, t, hw.suspend_timer);


	spin_lock_irq(&priv->lock);
	spin_lock_irq(&priv->lock);
	/*
	/*
@@ -1055,9 +1055,8 @@ int img_ir_probe_hw(struct img_ir_priv *priv)
	img_ir_probe_hw_caps(priv);
	img_ir_probe_hw_caps(priv);


	/* Set up the end timer */
	/* Set up the end timer */
	setup_timer(&hw->end_timer, img_ir_end_timer, (unsigned long)priv);
	timer_setup(&hw->end_timer, img_ir_end_timer, 0);
	setup_timer(&hw->suspend_timer, img_ir_suspend_timer,
	timer_setup(&hw->suspend_timer, img_ir_suspend_timer, 0);
				(unsigned long)priv);


	/* Register a clock notifier */
	/* Register a clock notifier */
	if (!IS_ERR(priv->clk)) {
	if (!IS_ERR(priv->clk)) {
+3 −3
Original line number Original line Diff line number Diff line
@@ -67,9 +67,9 @@ void img_ir_isr_raw(struct img_ir_priv *priv, u32 irq_status)
 * order to be assured of the final space. If there are no edges for a certain
 * order to be assured of the final space. If there are no edges for a certain
 * time we use this timer to emit a final sample to satisfy them.
 * time we use this timer to emit a final sample to satisfy them.
 */
 */
static void img_ir_echo_timer(unsigned long arg)
static void img_ir_echo_timer(struct timer_list *t)
{
{
	struct img_ir_priv *priv = (struct img_ir_priv *)arg;
	struct img_ir_priv *priv = from_timer(priv, t, raw.timer);


	spin_lock_irq(&priv->lock);
	spin_lock_irq(&priv->lock);


@@ -107,7 +107,7 @@ int img_ir_probe_raw(struct img_ir_priv *priv)
	int error;
	int error;


	/* Set up the echo timer */
	/* Set up the echo timer */
	setup_timer(&raw->timer, img_ir_echo_timer, (unsigned long)priv);
	timer_setup(&raw->timer, img_ir_echo_timer, 0);


	/* Allocate raw decoder */
	/* Allocate raw decoder */
	raw->rdev = rdev = rc_allocate_device(RC_DRIVER_IR_RAW);
	raw->rdev = rdev = rc_allocate_device(RC_DRIVER_IR_RAW);
+3 −4
Original line number Original line Diff line number Diff line
@@ -1090,9 +1090,9 @@ static void usb_tx_callback(struct urb *urb)
/**
/**
 * report touchscreen input
 * report touchscreen input
 */
 */
static void imon_touch_display_timeout(unsigned long data)
static void imon_touch_display_timeout(struct timer_list *t)
{
{
	struct imon_context *ictx = (struct imon_context *)data;
	struct imon_context *ictx = from_timer(ictx, t, ttimer);


	if (ictx->display_type != IMON_DISPLAY_TYPE_VGA)
	if (ictx->display_type != IMON_DISPLAY_TYPE_VGA)
		return;
		return;
@@ -2411,8 +2411,7 @@ static struct imon_context *imon_init_intf1(struct usb_interface *intf,
	mutex_lock(&ictx->lock);
	mutex_lock(&ictx->lock);


	if (ictx->display_type == IMON_DISPLAY_TYPE_VGA) {
	if (ictx->display_type == IMON_DISPLAY_TYPE_VGA) {
		setup_timer(&ictx->ttimer, imon_touch_display_timeout,
		timer_setup(&ictx->ttimer, imon_touch_display_timeout, 0);
			    (unsigned long)ictx);
	}
	}


	ictx->usbdev_intf1 = usb_get_dev(interface_to_usbdev(intf));
	ictx->usbdev_intf1 = usb_get_dev(interface_to_usbdev(intf));
Loading