Re: [PATCH] w1: matrox: Remove some deadcode in matrox_w1_remove()

From: Krzysztof Kozlowski
Date: Sun Aug 24 2025 - 14:09:20 EST


On 21/08/2025 12:02, Christophe JAILLET wrote:
> 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 <christophe.jaillet@xxxxxxxxxx>
> ---
> Compile tested only
> ---
> drivers/w1/masters/matrox_w1.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/w1/masters/matrox_w1.c b/drivers/w1/masters/matrox_w1.c
> index 2852cd2dc67c..146fa7c6e74e 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;

What wonderful code was this... Good catch, I'll apply it soon.

Best regards,
Krzysztof