net: vertexcom: mse102x: Add warning about IRQ trigger type

The example of the initial DT binding of the Vertexcom MSE 102x suggested
a IRQ_TYPE_EDGE_RISING, which is wrong. So warn everyone to fix their
device tree to level based IRQ.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250509120435.43646-3-wahrenst@gmx.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Stefan Wahren 2025-05-09 14:04:31 +02:00 committed by Jakub Kicinski
parent a29a728666
commit fed56943a8

View File

@ -8,6 +8,7 @@
#include <linux/if_vlan.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
@ -522,10 +523,25 @@ static irqreturn_t mse102x_irq(int irq, void *_mse)
static int mse102x_net_open(struct net_device *ndev)
{
struct irq_data *irq_data = irq_get_irq_data(ndev->irq);
struct mse102x_net *mse = netdev_priv(ndev);
struct mse102x_net_spi *mses = to_mse102x_spi(mse);
int ret;
if (!irq_data) {
netdev_err(ndev, "Invalid IRQ: %d\n", ndev->irq);
return -EINVAL;
}
switch (irqd_get_trigger_type(irq_data)) {
case IRQ_TYPE_LEVEL_HIGH:
case IRQ_TYPE_LEVEL_LOW:
break;
default:
netdev_warn_once(ndev, "Only IRQ type level recommended, please update your device tree firmware.\n");
break;
}
ret = request_threaded_irq(ndev->irq, NULL, mse102x_irq, IRQF_ONESHOT,
ndev->name, mse);
if (ret < 0) {