PCI/switchtec: Replace ENOTSUPP with EOPNOTSUPP
authorKelvin Cao <kelvin.cao@microchip.com>
Thu, 14 Oct 2021 14:18:58 +0000 (14:18 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 14 Oct 2021 14:22:47 +0000 (09:22 -0500)
ENOTSUPP is not a SUSV4 error code, and the following checkpatch.pl
warning will be given for new patches which still use ENOTSUPP.

    WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP

See the link below for the discussion.

  https://lore.kernel.org/netdev/20200511165319.2251678-1-kuba@kernel.org/

Replace ENOTSUPP with EOPNOTSUPP to align with future patches which will
be using EOPNOTSUPP.

Link: https://lore.kernel.org/r/20211014141859.11444-5-kelvin.cao@microchip.com
Signed-off-by: Kelvin Cao <kelvin.cao@microchip.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/switch/switchtec.c

index 97a93c9b4629a7164a460ec6dc066eee4148a7bf..236cb40cc7c569e7426efad6bf44594ca01adbd0 100644 (file)
@@ -376,7 +376,7 @@ static ssize_t field ## _show(struct device *dev, \
                return io_string_show(buf, &si->gen4.field, \
                                      sizeof(si->gen4.field)); \
        else \
-               return -ENOTSUPP; \
+               return -EOPNOTSUPP; \
 } \
 \
 static DEVICE_ATTR_RO(field)
@@ -668,7 +668,7 @@ static int ioctl_flash_info(struct switchtec_dev *stdev,
                info.flash_length = ioread32(&fi->gen4.flash_length);
                info.num_partitions = SWITCHTEC_NUM_PARTITIONS_GEN4;
        } else {
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
        }
 
        if (copy_to_user(uinfo, &info, sizeof(info)))
@@ -876,7 +876,7 @@ static int ioctl_flash_part_info(struct switchtec_dev *stdev,
                if (ret)
                        return ret;
        } else {
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
        }
 
        if (copy_to_user(uinfo, &info, sizeof(info)))
@@ -1611,7 +1611,7 @@ static int switchtec_init_pci(struct switchtec_dev *stdev,
        else if (stdev->gen == SWITCHTEC_GEN4)
                part_id = &stdev->mmio_sys_info->gen4.partition_id;
        else
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
 
        stdev->partition = ioread8(part_id);
        stdev->partition_count = ioread8(&stdev->mmio_ntb->partition_count);