IB/qib: Fix duplicate sysfs directory name
authorMike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
Thu, 17 Feb 2022 13:59:32 +0000 (08:59 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Mar 2022 10:48:08 +0000 (11:48 +0100)
commit72aa720acacf063dd0e62bc622296490de1c552f
treec813ee5d3bcd8a28c698bed2c8de2f61d1ebb95e
parent7a7e1b3aeef76936e40cc5cf5a4467e9aa608d5c
IB/qib: Fix duplicate sysfs directory name

commit 32f57cb1b2c8d6f20aefec7052b1bfeb7e3b69d4 upstream.

The qib driver load has been failing with the following message:

  sysfs: cannot create duplicate filename '/devices/pci0000:80/0000:80:02.0/0000:81:00.0/infiniband/qib0/ports/1/linkcontrol'

The patch below has two "linkcontrol" names causing the duplication.

Fix by using the correct "diag_counters" name on the second instance.

Fixes: 4a7aaf88c89f ("RDMA/qib: Use attributes for the port sysfs")
Link: https://lore.kernel.org/r/1645106372-23004-1-git-send-email-mike.marciniszyn@cornelisnetworks.com
Cc: <stable@vger.kernel.org>
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@cornelisnetworks.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/qib/qib_sysfs.c