drm/amdgpu/debugfs: fix error code when smc register accessors are NULL
authorjsg <jsg@openbsd.org>
Mon, 29 Jan 2024 01:39:33 +0000 (01:39 +0000)
committerjsg <jsg@openbsd.org>
Mon, 29 Jan 2024 01:39:33 +0000 (01:39 +0000)
From Alex Deucher
5bc4f16118c575410e7be220bbb9b1fa2ee4274b in linux-6.6.y/6.6.14
afe58346d5d3887b3e49ff623d2f2e471f232a8d in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_debugfs.c

index 3f2126f..418ff7c 100644 (file)
@@ -755,7 +755,7 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,
        int r;
 
        if (!adev->smc_rreg)
-               return -EPERM;
+               return -EOPNOTSUPP;
 
        if (size & 0x3 || *pos & 0x3)
                return -EINVAL;
@@ -814,7 +814,7 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user *
        int r;
 
        if (!adev->smc_wreg)
-               return -EPERM;
+               return -EOPNOTSUPP;
 
        if (size & 0x3 || *pos & 0x3)
                return -EINVAL;