Commit bceb4839 authored by Jan Kundrát's avatar Jan Kundrát Committed by Greg Kroah-Hartman

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: default avatarJan Kundrát <jan.kundrat@cesnet.cz>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 793ae04c
...@@ -1089,7 +1089,7 @@ static int max310x_gpio_direction_output(struct gpio_chip *chip, ...@@ -1089,7 +1089,7 @@ static int max310x_gpio_direction_output(struct gpio_chip *chip,
#endif #endif
static int max310x_probe(struct device *dev, struct max310x_devtype *devtype, static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
struct regmap *regmap, int irq, unsigned long flags) struct regmap *regmap, int irq)
{ {
int i, ret, fmin, fmax, freq, uartclk; int i, ret, fmin, fmax, freq, uartclk;
struct clk *clk_osc, *clk_xtal; struct clk *clk_osc, *clk_xtal;
...@@ -1239,7 +1239,7 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype, ...@@ -1239,7 +1239,7 @@ static int max310x_probe(struct device *dev, struct max310x_devtype *devtype,
/* Setup interrupt */ /* Setup interrupt */
ret = devm_request_threaded_irq(dev, irq, NULL, max310x_ist, ret = devm_request_threaded_irq(dev, irq, NULL, max310x_ist,
IRQF_ONESHOT | flags, dev_name(dev), s); IRQF_ONESHOT, dev_name(dev), s);
if (!ret) if (!ret)
return 0; return 0;
...@@ -1304,7 +1304,6 @@ static struct regmap_config regcfg = { ...@@ -1304,7 +1304,6 @@ static struct regmap_config regcfg = {
static int max310x_spi_probe(struct spi_device *spi) static int max310x_spi_probe(struct spi_device *spi)
{ {
struct max310x_devtype *devtype; struct max310x_devtype *devtype;
unsigned long flags = 0;
struct regmap *regmap; struct regmap *regmap;
int ret; int ret;
...@@ -1327,11 +1326,10 @@ static int max310x_spi_probe(struct spi_device *spi) ...@@ -1327,11 +1326,10 @@ static int max310x_spi_probe(struct spi_device *spi)
devtype = (struct max310x_devtype *)id_entry->driver_data; devtype = (struct max310x_devtype *)id_entry->driver_data;
} }
flags = IRQF_TRIGGER_FALLING;
regcfg.max_register = devtype->nr * 0x20 - 1; regcfg.max_register = devtype->nr * 0x20 - 1;
regmap = devm_regmap_init_spi(spi, &regcfg); regmap = devm_regmap_init_spi(spi, &regcfg);
return max310x_probe(&spi->dev, devtype, regmap, spi->irq, flags); return max310x_probe(&spi->dev, devtype, regmap, spi->irq);
} }
static int max310x_spi_remove(struct spi_device *spi) static int max310x_spi_remove(struct spi_device *spi)
......
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