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

Fixes logic error when block_recording is not supported but the fw attr was
being added anyway (reported by GitHub user bbregeault).

Tested myself on a Samsung Galaxy Book2 Pro (has block_recording) and by
bbregeault on a Galaxy Book2 Business (does not have block_recording).

Fixes: 56f529ce43 ("platform/x86: samsung-galaxybook: Add samsung-galaxybook driver")

Signed-off-by: Joshua Grisham <josh@joshuagrisham.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20250303132433.348653-1-josh@joshuagrisham.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
Joshua Grisham 2025-03-03 14:24:32 +01:00 committed by Ilpo Järvinen
parent 4878e0b14c
commit 7bb84ca9b8
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31

View File

@ -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,