Commit 8c15f723 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

serial: max3100: Remove duplicating irq field

The struct uart_port has a copy of the IRQ that is also stored
in the private data structure. Remove the duplication in the latter
one.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240409144721.638326-4-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 61f538f2
...@@ -93,8 +93,6 @@ struct max3100_port { ...@@ -93,8 +93,6 @@ struct max3100_port {
#define MAX3100_7BIT 4 #define MAX3100_7BIT 4
int rx_enabled; /* if we should rx chars */ int rx_enabled; /* if we should rx chars */
int irq; /* irq assigned to the max3100 */
int minor; /* minor number */ int minor; /* minor number */
int loopback_commit; /* need to change loopback */ int loopback_commit; /* need to change loopback */
int loopback; /* 1 if we are in loopback mode */ int loopback; /* 1 if we are in loopback mode */
...@@ -548,8 +546,8 @@ static void max3100_shutdown(struct uart_port *port) ...@@ -548,8 +546,8 @@ static void max3100_shutdown(struct uart_port *port)
destroy_workqueue(s->workqueue); destroy_workqueue(s->workqueue);
s->workqueue = NULL; s->workqueue = NULL;
} }
if (s->irq) if (port->irq)
free_irq(s->irq, s); free_irq(port->irq, s);
/* set shutdown mode to save power */ /* set shutdown mode to save power */
max3100_sr(s, MAX3100_WC | MAX3100_SHDN, &rx); max3100_sr(s, MAX3100_WC | MAX3100_SHDN, &rx);
...@@ -561,6 +559,7 @@ static int max3100_startup(struct uart_port *port) ...@@ -561,6 +559,7 @@ static int max3100_startup(struct uart_port *port)
struct max3100_port, struct max3100_port,
port); port);
char b[12]; char b[12];
int ret;
dev_dbg(&s->spi->dev, "%s\n", __func__); dev_dbg(&s->spi->dev, "%s\n", __func__);
...@@ -583,10 +582,10 @@ static int max3100_startup(struct uart_port *port) ...@@ -583,10 +582,10 @@ static int max3100_startup(struct uart_port *port)
} }
INIT_WORK(&s->work, max3100_work); INIT_WORK(&s->work, max3100_work);
if (request_irq(s->irq, max3100_irq, ret = request_irq(port->irq, max3100_irq, IRQF_TRIGGER_FALLING, "max3100", s);
IRQF_TRIGGER_FALLING, "max3100", s) < 0) { if (ret < 0) {
dev_warn(&s->spi->dev, "cannot allocate irq %d\n", s->irq); dev_warn(&s->spi->dev, "cannot allocate irq %d\n", port->irq);
s->irq = 0; port->irq = 0;
destroy_workqueue(s->workqueue); destroy_workqueue(s->workqueue);
s->workqueue = NULL; s->workqueue = NULL;
return -EBUSY; return -EBUSY;
...@@ -742,14 +741,13 @@ static int max3100_probe(struct spi_device *spi) ...@@ -742,14 +741,13 @@ static int max3100_probe(struct spi_device *spi)
return -ENOMEM; return -ENOMEM;
} }
max3100s[i]->spi = spi; max3100s[i]->spi = spi;
max3100s[i]->irq = spi->irq;
spin_lock_init(&max3100s[i]->conf_lock); spin_lock_init(&max3100s[i]->conf_lock);
spi_set_drvdata(spi, max3100s[i]); spi_set_drvdata(spi, max3100s[i]);
max3100s[i]->minor = i; max3100s[i]->minor = i;
timer_setup(&max3100s[i]->timer, max3100_timeout, 0); timer_setup(&max3100s[i]->timer, max3100_timeout, 0);
dev_dbg(&spi->dev, "%s: adding port %d\n", __func__, i); dev_dbg(&spi->dev, "%s: adding port %d\n", __func__, i);
max3100s[i]->port.irq = max3100s[i]->irq; max3100s[i]->port.irq = spi->irq;
max3100s[i]->port.fifosize = 16; max3100s[i]->port.fifosize = 16;
max3100s[i]->port.ops = &max3100_ops; max3100s[i]->port.ops = &max3100_ops;
max3100s[i]->port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; max3100s[i]->port.flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF;
...@@ -813,7 +811,7 @@ static int max3100_suspend(struct device *dev) ...@@ -813,7 +811,7 @@ static int max3100_suspend(struct device *dev)
dev_dbg(&s->spi->dev, "%s\n", __func__); dev_dbg(&s->spi->dev, "%s\n", __func__);
disable_irq(s->irq); disable_irq(s->port.irq);
s->suspending = 1; s->suspending = 1;
uart_suspend_port(&max3100_uart_driver, &s->port); uart_suspend_port(&max3100_uart_driver, &s->port);
...@@ -832,7 +830,7 @@ static int max3100_resume(struct device *dev) ...@@ -832,7 +830,7 @@ static int max3100_resume(struct device *dev)
uart_resume_port(&max3100_uart_driver, &s->port); uart_resume_port(&max3100_uart_driver, &s->port);
s->suspending = 0; s->suspending = 0;
enable_irq(s->irq); enable_irq(s->port.irq);
s->conf_commit = 1; s->conf_commit = 1;
if (s->workqueue) if (s->workqueue)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment