ENC28J60: Update interface to use newer parameter passing to interrupt handlers

This commit is contained in:
Gregory Nutt
2017-08-21 16:49:43 -06:00
parent 241c1433ef
commit 67befb9642
6 changed files with 31 additions and 14 deletions
+5 -2
View File
@@ -1833,7 +1833,10 @@ static void enc_irqworker(FAR void *arg)
static int enc_interrupt(int irq, FAR void *context, FAR void *arg)
{
register FAR struct enc_driver_s *priv = &g_enc28j60[0];
FAR struct enc_driver_s *priv;
DEBUGASSERT(arg != NULL);
priv = (FAR struct enc_driver_s *)arg;
/* In complex environments, we cannot do SPI transfers from the interrupt
* handler because semaphores are probably used to lock the SPI bus. In
@@ -2648,7 +2651,7 @@ int enc_initialize(FAR struct spi_dev_s *spi,
/* Attach the interrupt to the driver (but don't enable it yet) */
if (lower->attach(lower, enc_interrupt))
if (lower->attach(lower, enc_interrupt, priv) < 0)
{
/* We could not attach the ISR to the interrupt */
+2 -1
View File
@@ -1,6 +1,7 @@
/****************************************************************************
* drivers/net/encx24j600.c
*
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
* Copyright (C) 2013-2014 UVC Ingenieure. All rights reserved.
* Author: Max Holtzberg <mh@uvc.de>
*
@@ -1976,7 +1977,7 @@ static void enc_irqworker(FAR void *arg)
static int enc_interrupt(int irq, FAR void *context, FAR void *arg)
{
FAR struct enc_driver_s *priv = &g_encx24j600[0];
FAR struct enc_driver_s *priv;
DEBUGASSERT(arg != NULL);
priv = (FAR struct enc_driver_s *)arg;