From: Christophe JAILLET Date: Thu, 21 Aug 2025 10:02:21 +0000 (+0200) Subject: w1: matrox: Remove some deadcode in matrox_w1_remove() X-Git-Tag: v6.18-rc1~74^2~28^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=25fb0ea986dc10e05f3f4b43cabde4d1853a1fd7;p=thirdparty%2Fkernel%2Flinux.git w1: matrox: Remove some deadcode in matrox_w1_remove() The .remove function can only be called if the .probe() succeeds. So there is no need to keep track of a successful probe in 'found'. Simplify code accordingly. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/458641ad2d7a7adf30a03e70038304f0e6a81ff4.1755770484.git.christophe.jaillet@wanadoo.fr Signed-off-by: Krzysztof Kozlowski --- diff --git a/drivers/w1/masters/matrox_w1.c b/drivers/w1/masters/matrox_w1.c index 2852cd2dc67c9..146fa7c6e74ea 100644 --- a/drivers/w1/masters/matrox_w1.c +++ b/drivers/w1/masters/matrox_w1.c @@ -47,7 +47,6 @@ struct matrox_device { unsigned long phys_addr; void __iomem *virt_addr; - unsigned long found; struct w1_bus_master *bus_master; }; @@ -158,8 +157,6 @@ static int matrox_w1_probe(struct pci_dev *pdev, const struct pci_device_id *ent pci_set_drvdata(pdev, dev); - dev->found = 1; - dev_info(&pdev->dev, "Matrox G400 GPIO transport layer for 1-wire.\n"); return 0; @@ -176,10 +173,9 @@ static void matrox_w1_remove(struct pci_dev *pdev) { struct matrox_device *dev = pci_get_drvdata(pdev); - if (dev->found) { - w1_remove_master_device(dev->bus_master); - iounmap(dev->virt_addr); - } + w1_remove_master_device(dev->bus_master); + iounmap(dev->virt_addr); + kfree(dev); }