+ ret = request_irq(rdev->irq, rswitch_gwca_data_irq, IRQF_SHARED,It wasn't shared previously, maybe some notes in commit message about
that.
+ err = of_property_read_u32(rdev->np_port, "irq-index", &irq_index);Usually if (!err) is used.
+ if (err == 0) {
+ if (irq_index < GWCA_NUM_IRQS)Why not return here? It is a little counter intuitive, maybe:
+ rdev->irq_index = irq_index;
+ else
+ dev_warn(&rdev->priv->pdev->dev,
+ "%pOF: irq-index out of range\n",
+ rdev->np_port);
if (err) {
dev_warn();
return -ERR;
}
if (irq_index < NUM_IRQS) {
dev_warn();
return -ERR;
}
+ }
+
+ name = kasprintf(GFP_KERNEL, GWCA_IRQ_RESOURCE_NAME, rdev->irq_index);
In case with not returning you are using invalid rdev_irq_index here
(probably 0, so may it be fine, I am only wondering).
+ if (!name)
+ return -ENOMEM;
+ err = platform_get_irq_byname(rdev->priv->pdev, name);
+ kfree(name);
+ if (err < 0)
+ return err;
+ rdev->irq = err;
If you will be changing sth here consider:
rdev->irq = platform()
if (rdev->irq < 0)
return rdev->irq;
+ err = rswitch_port_get_irq(rdev);You are returning 0 in case of success, the netdev code style is to
+ if (err < 0)
check it like that: if (!err)
+ goto out_get_irq;If you will use the label name according to what does happen under label
you will not have to add another one. Feel free to leave it as it is, as
you have the same scheme across driver with is completle fine. You can
check Przemek's answer according "came from" convention [1].