Re: [RFC PATCH 2/4] iio: accel: fxls8962af: add interrupt support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/28/21 10:22 AM, Sean Nyekjaer wrote:
Preparation commit for the next that adds hw buffered sampling

Signed-off-by: Sean Nyekjaer <sean@xxxxxxxxxx>
---
[...]
+static void fxls8962af_get_irq(struct device_node *of_node, enum fxls8962af_int_pin *pin)
+{
+	int irq;
+
+	irq = of_irq_get_byname(of_node, "INT2");

For this I'd use device_property_match_string(dev, "interrupt-names", "INT2"). Means it won't try to map the interrupt again, and also this is the only place where the driver directly depends on OF, everything else already uses the device_ API.


+	if (irq > 0) {
+		*pin = FXLS8962AF_PIN_INT2;
+		return;
+	}
+
+	*pin = FXLS8962AF_PIN_INT1;
+}




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux