Skip to content

Commit bceb483

Browse files
jktjktgregkh
authored andcommitted
serial: max310x: Do not hard-code the IRQ type
As suggested by Russell King, a driver should not really care about bits such as the interrupt polarity or whether it is edge- or level- triggered. The reasons for that include: - an upstream IRQ controller which cannot support edge- or level-triggered interrupts, - board design with a built-in inverter The interrupt type is being already specified by the Device Tree, anyway. Other drivers (gpio/gpio-tc3589x.c for example) already work in this way, delegating the proper IRQ line setup to the DT and not specifying anything by hand. Also, there's no reason to have the IRQ flags split between two places. The SPI probing is the only entry point anyway. Signed-off-by: Jan Kundrát <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 793ae04 commit bceb483

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/tty/serial/max310x.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ static int max310x_gpio_direction_output(struct gpio_chip *chip,
10891089
#endif
10901090

10911091
static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
1092-
struct regmap *regmap, int irq, unsigned long flags)
1092+
struct regmap *regmap, int irq)
10931093
{
10941094
int i, ret, fmin, fmax, freq, uartclk;
10951095
struct clk *clk_osc, *clk_xtal;
@@ -1239,7 +1239,7 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
12391239

12401240
/* Setup interrupt */
12411241
ret = devm_request_threaded_irq(dev, irq, NULL, max310x_ist,
1242-
IRQF_ONESHOT | flags, dev_name(dev), s);
1242+
IRQF_ONESHOT, dev_name(dev), s);
12431243
if (!ret)
12441244
return 0;
12451245

@@ -1304,7 +1304,6 @@ static struct regmap_config regcfg = {
13041304
static int max310x_spi_probe(struct spi_device *spi)
13051305
{
13061306
struct max310x_devtype *devtype;
1307-
unsigned long flags = 0;
13081307
struct regmap *regmap;
13091308
int ret;
13101309

@@ -1327,11 +1326,10 @@ static int max310x_spi_probe(struct spi_device *spi)
13271326
devtype = (struct max310x_devtype *)id_entry->driver_data;
13281327
}
13291328

1330-
flags = IRQF_TRIGGER_FALLING;
13311329
regcfg.max_register = devtype->nr * 0x20 - 1;
13321330
regmap = devm_regmap_init_spi(spi, &regcfg);
13331331

1334-
return max310x_probe(&spi->dev, devtype, regmap, spi->irq, flags);
1332+
return max310x_probe(&spi->dev, devtype, regmap, spi->irq);
13351333
}
13361334

13371335
static int max310x_spi_remove(struct spi_device *spi)

0 commit comments

Comments
 (0)