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

Commit 7e33da59 authored by Kees Cook's avatar Kees Cook Committed by Greg Kroah-Hartman
Browse files

usb: isp1760: 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: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Cc: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 09e005c4
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -1258,10 +1258,11 @@ static irqreturn_t isp1760_irq(struct usb_hcd *hcd)
#define SLOT_TIMEOUT 300
#define SLOT_TIMEOUT 300
#define SLOT_CHECK_PERIOD 200
#define SLOT_CHECK_PERIOD 200
static struct timer_list errata2_timer;
static struct timer_list errata2_timer;
static struct usb_hcd *errata2_timer_hcd;


static void errata2_function(unsigned long data)
static void errata2_function(struct timer_list *unused)
{
{
	struct usb_hcd *hcd = (struct usb_hcd *) data;
	struct usb_hcd *hcd = errata2_timer_hcd;
	struct isp1760_hcd *priv = hcd_to_priv(hcd);
	struct isp1760_hcd *priv = hcd_to_priv(hcd);
	int slot;
	int slot;
	struct ptd ptd;
	struct ptd ptd;
@@ -1333,7 +1334,8 @@ static int isp1760_run(struct usb_hcd *hcd)
	if (retval)
	if (retval)
		return retval;
		return retval;


	setup_timer(&errata2_timer, errata2_function, (unsigned long)hcd);
	errata2_timer_hcd = hcd;
	timer_setup(&errata2_timer, errata2_function, 0);
	errata2_timer.expires = jiffies + msecs_to_jiffies(SLOT_CHECK_PERIOD);
	errata2_timer.expires = jiffies + msecs_to_jiffies(SLOT_CHECK_PERIOD);
	add_timer(&errata2_timer);
	add_timer(&errata2_timer);


+3 −4
Original line number Original line Diff line number Diff line
@@ -1331,9 +1331,9 @@ static irqreturn_t isp1760_udc_irq(int irq, void *dev)
	return status ? IRQ_HANDLED : IRQ_NONE;
	return status ? IRQ_HANDLED : IRQ_NONE;
}
}


static void isp1760_udc_vbus_poll(unsigned long data)
static void isp1760_udc_vbus_poll(struct timer_list *t)
{
{
	struct isp1760_udc *udc = (struct isp1760_udc *)data;
	struct isp1760_udc *udc = from_timer(udc, t, vbus_timer);
	unsigned long flags;
	unsigned long flags;


	spin_lock_irqsave(&udc->lock, flags);
	spin_lock_irqsave(&udc->lock, flags);
@@ -1452,8 +1452,7 @@ int isp1760_udc_register(struct isp1760_device *isp, int irq,
	udc->regs = isp->regs;
	udc->regs = isp->regs;


	spin_lock_init(&udc->lock);
	spin_lock_init(&udc->lock);
	setup_timer(&udc->vbus_timer, isp1760_udc_vbus_poll,
	timer_setup(&udc->vbus_timer, isp1760_udc_vbus_poll, 0);
		    (unsigned long)udc);


	ret = isp1760_udc_init(udc);
	ret = isp1760_udc_init(udc);
	if (ret < 0)
	if (ret < 0)