diff mbox series

platform/x86: samsung-galaxybook: Fix block_recording not supported logic

Message ID 20250302205350.32509-1-josh@joshuagrisham.com (mailing list archive)
State Changes Requested, archived
Headers show
Series platform/x86: samsung-galaxybook: Fix block_recording not supported logic | expand

Commit Message

Joshua Grisham March 2, 2025, 8:53 p.m. UTC
Fixes logic error when block_recording is not supported but the fw attr is
being added anyway (reported by GitHub user bbregeault).

Signed-off-by: Joshua Grisham <josh@joshuagrisham.com>
---
 drivers/platform/x86/samsung-galaxybook.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Ilpo Järvinen March 3, 2025, 10:53 a.m. UTC | #1
On Sun, 2 Mar 2025, Joshua Grisham wrote:

> Fixes logic error when block_recording is not supported but the fw attr is
> being added anyway (reported by GitHub user bbregeault).
> 
> Signed-off-by: Joshua Grisham <josh@joshuagrisham.com>

Please add a Fixes tag.
diff mbox series

Patch

diff --git a/drivers/platform/x86/samsung-galaxybook.c b/drivers/platform/x86/samsung-galaxybook.c
index de1ed2dc6..5878a3519 100644
--- a/drivers/platform/x86/samsung-galaxybook.c
+++ b/drivers/platform/x86/samsung-galaxybook.c
@@ -1100,11 +1100,13 @@  static int galaxybook_fw_attrs_init(struct samsung_galaxybook *galaxybook)
 	}
 
 	err = galaxybook_block_recording_init(galaxybook);
-	if (!err)
-		galaxybook->has_block_recording = true;
-	else if (err != GB_NOT_SUPPORTED)
+	if (err == GB_NOT_SUPPORTED)
+		return 0;
+	else if (err)
 		return err;
 
+	galaxybook->has_block_recording = true;
+
 	return galaxybook_fw_attr_init(galaxybook,
 				       GB_ATTR_BLOCK_RECORDING,
 				       &block_recording_acpi_get,